Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

VB6 ucSimpleTab (a simple, low-code TabCtl without SubClassing)

$
0
0
Just a simple Tab-Control, based on a VB-Label-ControlArray.

It looks like this:
Name:  SimpleTabLabels.png
Views: 48
Size:  12.5 KB

The User-Code (initializing the TabCtl - and reacting to Events) in the Demo-Form is this:
Code:

Option Explicit

Private Sub Form_Load()
  ucSimpleTab1.InitTabCtl vbWindowBackground, vbActiveBorder, vbButtonText, vbButtonFace, _
                          "Tab A", "Tab B", "Tab C" 'Tab-Captions
End Sub

Private Sub Form_Click()
  ucSimpleTab1.Font.Size = 11 'the TabCtl automatically reacts to Font-Changes
End Sub
 
Private Sub ucSimpleTab1_Click(ByVal CurTab As Object) 'the only Event of this TabCtl
  Caption = "Selected TabIdx: " & ucSimpleTab1.TabIdx & " (" & CurTab.Caption & ")"
End Sub

And the code-zip is here: SimpleTabs.zip

Have fun with it,

Olaf
Attached Images
 
Attached Files

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>