Download source code and demo - 130 KB

This is a lightweight control (just 84kb compiled) that adds Visual Studio style tabs to your projects. With a small footprint, this dll is a good start point to enhance your app user interface (just rewriting the "RenderItem" code you can modify the item aspect to fit your needs). Simple demo project included.
The control is very easy to use. Here is actial full source code of the demo app:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85:
|
Private WithEvents m_oVTabs As CVSTabs
Private WithEvents m_oXPTabs As CXPTabs
Private m_oLastTab As TabItem
Private Sub Form_Load()
Set m_oVTabs = New CVSTabs
With m_oVTabs
.LinkControl picTabs
With .Tabs
.Add "frmMultiRecord.vb"
.Add "frmData.vb"
.Add "frmMachine.vb"
.Add "About"
.Item(1).SetActive
End With
.RebuildImage
End With
Set m_oXPTabs = New CXPTabs
With m_oXPTabs
.LinkControl picXP
With .Tabs
.Add "frmMultiRecord.vb"
.Add "frmData.vb"
.Add "frmMachine.vb"
.Add "Do you like it?"
End With
.RebuildImage
End With
End Sub
Private Sub Form_Resize()
picXP.Width = ScaleWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set m_oVTabs = Nothing
End Sub
Private Sub m_oVTabs_TabActivated(oTab As rsVStudiotabs.TabItem)
If (oTab.Key = "About") Then
m_oVTabs.ShowAbout
m_oLastTab.SetActive
End If
End Sub
Private Sub m_oVTabs_TabDeactivated(oTab As TabItem)
lblStatus = "Tab """ & oTab.Caption & """ deactivated."
Debug.Print lblStatus
Set m_oLastTab = oTab
End Sub
Private Sub m_oXPTabs_TabActivated(oTab As rsVStudiotabs.TabItem)
lblStatus = "Tab """ & oTab.Caption & """ activated."
Debug.Print lblStatus
End Sub
Private Sub tmrCaption_Timer()
Dim LnIndex As Integer
Dim LsTag As String
LnIndex = ((Timer Mod m_oXPTabs.Tabs.Count) + 1)
With m_oXPTabs.Tabs(LnIndex)
If (.Tag = "") Then
.Tag = .Caption
.Caption = (.Caption & "*")
Else
.Caption = .Tag
.Tag = ""
End If
End With
End Sub
Private Sub tmrFlip_Timer()
m_oXPTabs.OnTop = (Not m_oXPTabs.OnTop)
End Sub
Private Sub tmrSelect_Timer()
Dim LnIndex As Integer
LnIndex = ((Timer Mod m_oXPTabs.Tabs.Count) + 1)
m_oXPTabs.Tabs(LnIndex).SetActive
End Sub
|
License
You are free to use this component in your own projects as long as you include the following text in your about box:
"Portions RamoSoft de México http://www.ramosoft.com/"
Please email me your comments.
Leontti A. Ramos M. (leontti@leontti.net)
Updates
10/3/2001 - Version 1.0.1. Updated with new .NET style tabs (suggested by Steven Sartain)
10/12/2001 - Version 1.0.2. Fixes a bug that caused a memory leak after some time using the code. The bug was noticed by Edward Moth, thank you.
2/20/2002 - Version 1.0.3. Added "those nice nifty arrows that appear if you have too many tabs to fit", as suggested by Steve Sartain. A small bug when removing a tab has been fixed.
Download source code and demo - 130 KB
|