Ok here is a solution that maybe we both can agree on. It gives the pro-look, and is very easy to work with. Any thoughts, good or bad?
Requires the user to do only the following.
1) The user puts the following labels on the form:
lbl1,lbl2, to lblN where N is the number of pages. Provide each its own color.
lblHilite
lblStrip
user does not have to worry about sizing, positioning or formatting or adding event procedures. Code takes care of all of that.
2) The user adds tab control tbCntrl1
3) The user can keep the tab in "tab" style during design which allows quick and easy designing. Easy access to modifying controls on various tabs. Just like working with any tab control. My big issues was working with "pseudo tabs" stacked on each other. That seemed difficult to do any modification.
That is it. The code does the rest. Formats everything real nice and provides the functionality. The user can modify the depressLabel procedure to provide a different look. The code handles any number of tabs.
Code:
Public Function changeTab(intTab As Integer)
Me.tbCtrl1.Value = intTab - 1
depressLabel (intTab)
End Function
Private Sub Form_Load()
Dim lblCount As Integer
Dim i As Integer
Dim lblWidth As Long
Dim tempLeft As Long
lblCount = Me.tbCtrl1.Pages.Count
'need to ensure you have as many labels as pages
'need to ensure your control labels are lbl1 to lblN
'Need a lblHilite
Me.tbCtrl1.Style = 2
Me.tbCtrl1.BackStyle = 0
'Format lblhilite
With Me.lblHilite
.Width = Me.tbCtrl1.Width
.Height = Me.tbCtrl1.Height
.Top = Me.tbCtrl1.Top
.Left = Me.tbCtrl1.Left
.Caption = ""
End With
lblWidth = lblHilite.Width / lblCount
tempLeft = Me.lblHilite.Left
For i = 1 To lblCount
'Format labels
With Me.Controls("lbl" & i)
.Left = tempLeft
.Width = lblWidth
.Top = Me.tbCtrl1.Top - Me.lbl1.Height
.Height = Me.lbl1.Height
.OnClick = "=changeTab(" & i & ")"
End With
tempLeft = tempLeft + Me.Controls("lbl" & i).Width
Next i
'Format the strip between the labels and boxes
With Me.lblStrip
.Left = Me.lblHilite.Left
.Top = Me.lbl1.Top + Me.lbl1.Height
.Width = Me.lblHilite.Width
.BackColor = Me.lbl1.BackColor
.Caption = ""
End With
End Sub
Public Sub depressLabel(intLabel As Integer)
Dim lblCount As Integer
Dim i As Integer
lblCount = Me.tbCtrl1.Pages.Count
For i = 1 To lblCount
With Me.Controls("lbl" & i)
'Flat and unBold
.SpecialEffect = 0
.FontBold = False
.FontUnderline = False
.FontItalic = 0
.BorderStyle = 0
End With
Next i
With Me.Controls("lbl" & intLabel)
'Sunken Bold
.SpecialEffect = 2
.FontBold = True
.FontUnderline = True
.FontItalic = True
End With
Me.lblStrip.BackColor = Me.Controls("lbl" & intLabel).BackColor
Me.lblHilite.BackColor = Me.Controls("lbl" & intLabel).BackColor
End Sub
What it looks like in design view
What it looks like on open.
modified to select just one