How to programmatically click on the next tab page.

G

Guest

I've tried the following, and it sets the focus to the tab, but it doesn't
put the square box on the tab like it does when you use the mouse to click on
a tab. Therefore, when you press the right and left arrows, it doesn't go to
the next tab.

Here's what I was trying to emulate clicking on the 3rd tab.
this.tabProductCategories.SelectedIndex = 2;
this.tabProductCategories.TabPages[2].Focus();
this.tabProductCategories.TabPages[2].Select();
 
T

Truong Hong Thi

Hi Vern,

this.tabProductCategories.SelectedIndex = 2;
this.tabProductCategories.TabPages[2].Parent.Focus(); // Select is also
OK

Hope this helps,
Thi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top