tab control

how to change tab size when click the tab

Page 1 of 1

4 Replies - 4569 Views - Last Post: 30 December 2009 - 09:04 AM Rate Topic: -----

#1 vasanthkumar  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 12
  • Joined: 29-December 09

tab control

Post icon  Posted 29 December 2009 - 01:18 AM

hi i'm vasanth, i'm new to vb.net . i'm using windows application ,i just want to know how to change the tabpage size when click the tab. plz anybody help me.
Is This A Good Question/Topic? 0
  • +

Replies To: tab control

#2 jhouns  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 62
  • Joined: 21-December 09

Re: tab control

Posted 29 December 2009 - 03:14 AM

Assuming you are using a tab control you can use this simple code
	Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
		TabControl1.Width += 5
	End Sub



Or click the tab control and go to the properties inspector in the bottom right and click the little lightning bolt icon to go to the events menu. Then find 'selected index changed' and double click in the box to its right. Then type in the change of size you want whenever the tab is changed. alternatively you could check it against it's name like so

Public Class Form1

	Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
		TabControl1.Width += 5
		Select Case TabControl1.Name
			Case "tab1"
				'set size
			Case "tab2"
				'set size
		End Select
	End Sub
End Class




Any questions?
Was This Post Helpful? 0
  • +
  • -

#3 vasanthkumar  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 12
  • Joined: 29-December 09

Re: tab control

Posted 29 December 2009 - 09:57 PM

thank u. but in select case there is case "tab1" wat is this. plz reply.
Was This Post Helpful? 0
  • +
  • -

#4 vasanthkumar  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 12
  • Joined: 29-December 09

Re: tab control

Posted 29 December 2009 - 10:36 PM

thanx for ur help. it is working fine now.
instead of Tabcontrol1.name i'm using TabControl1.SelectedIndex.
Was This Post Helpful? 0
  • +
  • -

#5 jhouns  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 62
  • Joined: 21-December 09

Re: tab control

Posted 30 December 2009 - 09:04 AM

np good luck with your project
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1