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!

SSTab with a frame showing in more than 1 tab

Status
Not open for further replies.

rjmccorkle

Programmer
Aug 26, 2000
55
0
0
US
In 2 different projects I have experienced the following: a form with an SSTab control with multiple tabs and a Frame placed in one of the tabs has the frame showing in 2 of the tabs. I discovered this morning in one of them that if I set the focus to the tab with the frame in design mode then run it, it works as expected. If the focus is set on one of the other tabs in design mode then run, the frame shows in both the tab with the focus AND the tab where it was placed. I just tried a quick project to try to recreate it using just a 3 tab SSTab and a frame in tab 2, focus on tab 1 or 3, then run and it works ok. Any ideas? Thanks, Bob
 
It's because you're positioning the frames in code (probably) rather than leaving them where you put them at design time.

SSTab is unforgiving when it comes to moving its children, if you query the .Left property of one of the frames you'll find it's -5364 or something, and the next is -1089 and so on, which makes moving them in code very tricky.

If your tab panels are already in an array of frames it's a lot easier to use the Windows TabStrip instead of SSTab and just say something like:

Code:
For a& = 1 to TabStrip1.Tabs.Count
  Frame(a&).Visible = (a& = TabStrip1.SelectedItem.Index)
Next a&

This means that when the user clicks tab #3 it'll show frame(3).

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Thanks Andy. I am setting the position of the frame in the Form Load. I'll experiment at home tonight to see if that is the cause. I haven't worked with TabStrips before so I'll research them as well.
 
Thanks again Andy. Setting the position in code is what triggered the multi-tab "feature". The Frame in question was the only one with Visible set True. I had 3 other ones whose positions were set in Form Load but their Visible was set False. I use them as pop-ups in their own tab so I didn't notice if they showed up in a different tab. If I remember this incident maybe some day I can put it to use. Bob
 
I've had the same thing happen to me which was why it rang a bell, although I think in my case I was trying to resize the frames if the form itself resized and I was getting frames all over the place!

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top