Public Sub subTbl(tlbItem As Object, Optional bImage As Boolean = True)
Dim i%, str$, j%
frmMain.Tag = tlbItem.Parent.Name
With frmMain.tlbMain.Buttons
For i = tlbItem.Buttons.Count To 1 Step -1
str = tlbItem.Buttons(i).Image
If bImage = True Then
If str <> "0" Then
.Add CON_TLBMAINCOUNT - 1, tlbItem.Buttons(i).Key, IIf(.Item("tlbExit").Caption = gsNULL, gsNULL, tlbItem.Buttons(i).Caption), , str
Else
.Add CON_TLBMAINCOUNT - 1, tlbItem.Buttons(i).Key, IIf(.Item("tlbExit").Caption = gsNULL, gsNULL, tlbItem.Buttons(i).Caption)
End If
Else
.Add CON_TLBMAINCOUNT - 1, tlbItem.Buttons(i).Key, IIf(.Item("tlbExit").Caption = gsNULL, gsNULL, tlbItem.Buttons(i).Caption)
End If
.Item(CON_TLBMAINCOUNT - 1).Visible = tlbItem.Buttons(i).Visible
.Item(CON_TLBMAINCOUNT - 1).Style = tlbItem.Buttons(i).Style
.Item(CON_TLBMAINCOUNT - 1).Enabled = tlbItem.Buttons(i).Enabled
.Item(CON_TLBMAINCOUNT - 1).Description = tlbItem.Buttons(i).Description
.Item(CON_TLBMAINCOUNT - 1).ToolTipText = tlbItem.Buttons(i).ToolTipText
If tlbItem.Buttons(i).Style = tbrDropdown Then
For j = 1 To tlbItem.Buttons(i).ButtonMenus.Count
.Item(CON_TLBMAINCOUNT - 1).ButtonMenus.Add j, tlbItem.Buttons(i).ButtonMenus(j).Key, tlbItem.Buttons(i).ButtonMenus(j).Text
Next j
End If
Next i
tlbItem.Visible = False
End With
End Sub
Public Sub subDelTbl(tlbItem As Object)
Dim i%
If frmMain.Tag <> tlbItem.Parent.Name Then Exit Sub
With frmMain.tlbMain.Buttons
If .Count = CON_TLBMAINCOUNT Then Exit Sub
For i = 1 To tlbItem.Buttons.Count
.Remove CON_TLBMAINCOUNT - 1
Next i
End With
End Sub