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!

VB6: TabStrip, can you swap tabs ?

Status
Not open for further replies.

rzirpolo

Programmer
Apr 8, 2002
163
GB
Basically I have 4 tabs in my TabStrip. Is there any easy way to swap the order of two of them ?

When I state order I mean to actually move it so for example what was the 3rd tab is now displayed as the 2nd tab ?

Looking at the properties it doesn't look like you can do this easily. Unless I'm wrong ?

 
Edit the FRM file manually.

Make a backup *before* you attempt the change in case things get out of hand and the file gets mangled. The TabStrip properties in the form probably look like this ...

Begin MSComctlLib.TabStrip TabStrip1
Height = 735
Left = 360
TabIndex = 0
Top = 900
Width = 4395
_ExtentX = 7752
_ExtentY = 1296
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 4
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "One"
Key = "One"
Object.ToolTipText = "One"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Two"
Key = "Two"
Object.ToolTipText = "Two"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Three"
Key = "Three"
Object.ToolTipText = "Three"
ImageVarType = 2
EndProperty
BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Four"
Key = "Four"
Object.ToolTipText = "Four"
ImageVarType = 2
EndProperty
EndProperty
End

You can edit the file to, for example, swap tab 2 for tab 4 so it would look like this ...

Begin MSComctlLib.TabStrip TabStrip1
Height = 735
Left = 360
TabIndex = 0
Top = 900
Width = 4395
_ExtentX = 7752
_ExtentY = 1296
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 4
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "One"
Key = "One"
Object.ToolTipText = "One"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Four"
Key = "Four"
Object.ToolTipText = "Four"
ImageVarType = 2
EndProperty
BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Three"
Key = "Three"
Object.ToolTipText = "Three"
ImageVarType = 2
EndProperty
BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "Two"
Key = "Two"
Object.ToolTipText = "Two"
ImageVarType = 2
EndProperty
EndProperty
End

I'll say it again because it's important ...

Make a backup *before* you attempt the change in case things get out of hand and the file gets mangled.


Net_Giant

What fun is a technology if you can't crash the OS?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top