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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can sst Tabs be repositioned?

Status
Not open for further replies.

Sideman

Technical User
Apr 21, 2003
41
US
Hi folks,
Using VB6, SP5, Access 2000
I have an sst Tab Control with 5 tabs and various controls on all tabs. Is it possible to change the positions of the tabs?...ie., move tab 4 to tab 2 position something like on an Excel 2000 worksheet? I'm inclined to think it can't be done easily due to the way VB6 handles displaying tabs, but needed to ask anyway. Any advice?

Of all the things I've lost, I miss my mind the most!
Sideman
 
Ive never tried it but I believe this should work - Open the .frm with notepad then look for the tabs collection
you will see several entries for each tab like
Tab(0)...
Tab(0)...
Tab(0)...
Tab(1)...
Tab(1)...
Renumber the indexes and swap the positions as appropriate.

Save beforehand and maybe get a second opion.

Hope this makes sense.
 
It has been my experience with sst tabs that if you want to change the tabbing order, you have to do it the difficulet and painful way.

It's the worst part when working with sst tabs. You can change the names on the tabs easily, but you have to physically move the controls from one tab to the one where you want them.

Good luck

Transcend
[gorgeous]
 
Although sonofemedic's solution might work, but i'd save the form elsewhere before you try it :)

Transcend
[gorgeous]
 
There is no easy way to move the controls from one tab to another.

You can use SonOfEmidec1100's approach by modifying the .frm file direction, but with tabs, this is extremely dangerous, and usually will fail because you're not able to update the corresponding .frx file in a like manner. You may find it quite difficult to update the X locations.

I would recommend something like the following:

Step one: Make a copy of the project/form before you begin including the .frx file.

Ok, on each tab, add a frame, and then group all of the controls together by clicking each control while holding down the control key, and when all controls are selected, Cut the controls, and then paste them into the frame on the same tab. After you've done this for each tab, add a new tab (in your case, tab #6) to be used a scratch pad where you can easily move or hold the frame which corresponds to any tab. Now you can fairly easily move the controls around by moving the frames on each tab.

As a standard method, I always have a frame on each tab for flexibility down the road should I need it.

There is another advantage to having all of the controls in a frame instead of directly on the tab. If you need to identify which controls are on which tab, you can do so by checking the frame parent associated with the that control individuals tabs.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 

You could also need changes to code as well, especially if you make use of the SelectedTab value or does that only apply to the ssindextab?

I would go with CajunCenturion - probably less work and future changes are simplified.



 
CajunCenturion makes a good point,

I usually make it a habit to have a frame on each tab and group all of the controls that way, in case i ever do need to move them all, it makes it much easier.

Transcend
[gorgeous]
 
be aware that you can mark the controls on an SSTab with the mouse. Click in the titlebar of the form (the form has to be marked), hold down Ctrl and catch the controls with the mouse

Andreas
 
It is also a good idea to use a frame because of a small bug that the SSTab has when a label is on it...the SSTab's CausesValidation doesn't cause validation for controls with a validation event...

Place two text boxes and a label on a tab.
Put
debug.Print "Validated"
in the text boxes validation events.

Make sure the SSTab's CausesValidation property is set to True (Default)

Click inside one of the text boxes.

Click on another tab.

No validation occures.

Try the same with the label and text boxes on a frame.

Now Validation fires.
 
WOW! Another nugget for M$ to add to the next VB release!

Thanks for all your input guys. I'll try all suggestions and let you know what works the least painfully...although I suspect something along the lines of CajunCenturion's idea is what I'll end up using...,cut and paste, cut and paste, cut and paste, cut and paste, cut and paste, cut and paste, cut and paste, cut and paste, ..........ARGHHHH!

PS. Good tip, CCLINT...Thanks.

Thanks for your input guys.

Of all the things I've lost, I miss my mind the most!
Sideman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top