Tab Control..

Hi,

I've used tab control in my VB.NET Windows (VS2003) project.
My apps has two tabs named "Sub1" & "sub2"

1) I wish to fire a clicking event of button when i click "sub1" tab. Need to have event handlers?

2)"Sub2" tab page has many labels and buttons. I wish to display only few of them when "sub2" tab is clicked.
To do this ,Which event i need to use?

I've seen click event for tab pages. but it fires only when the page is clicked. I want to do the above when the tabs get clicked.

Kindly guide me .
Thank You.

[625 byte] By [ar_pad] at [2007-12-24]
# 1

Hi,

you could use the SelectedIndexChanged event to handle tab pages changes. In its event hander you can access the currently selected tab by the SelectedTab property.

Andrej

AndrejTozon at 2007-8-31 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2

For question 1.

Firstly, please distinguish between tab control and tab page. In your case, I guess both "Sub1" and "Sub2" are tab pages of a certain tab control.

Second, what you want is to simulate a mouse click event on buttons when the "Sub1" tab page is actually clicked? If it is, I think a PInvoke of SendMessage may be your best solution.

I hope i don't misunderstand you

gqlu at 2007-8-31 > top of Msdn Tech,Windows Forms,Windows Forms General...