Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a Specific Tab on a TabControl now working?

Status
Not open for further replies.

bentleygt

Programmer
Feb 24, 2004
16
0
0
US
I have a window with a user object on it. The user object is a tab control. I have logic in the open event of the window and based on certain logic I want to select a specific tab.

I've used the follwoing logic and both do not work:
tab_1.selectedtab = 3

OR

tab_1.selecttab(3)

What happens when the window opens, for a split second the right tab gets selected than automatically gos back to the first tab.

Why does it select the correct tab for a second and then selects the first tab?
How do I correct this so the proper tab is selected depending on the open event logic?

I'm using PB6.5



 
Try Posting (in a 'ue_postopen' type event) the "tab_1.selecttab(3)" command from the Open event
 
1. Create new user event for the tab control:

tab_1::eek:n_select()
{
Code:
integer li_index
li_index = Message.LongParm
tb_1.selecttab (li_index)
}

2. Put in window::eek:pen() event this:
Code:
// li_index = tabpage index
tb_1.postevent ("on_select", 0, li_index)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top