Newbie question: How to add button in toolbar?

futura
04-05-2003, 10:52 PM
Hi:

I have no any idea of adding button in toolbar...

Please help. Thanks.

:)

BankCop
04-06-2003, 08:59 PM
Hi:

I have no any idea of adding button in toolbar...

Please help. Thanks.

:)



Private Sub SetupToolbar(imgTool As ImageList)

With Me

With .Toolbar1
.ImageList = imgTool
.Buttons.Clear
.Buttons.Add , "Forgery", , tbrDefault, imgTool.ListImages("Forgery").Key
.Buttons("Forgery").ToolTipText = " Forgery/Counterfeit Loss "
.Buttons.Add , "ProceduralLoss", , tbrDropdown, imgTool.ListImages(" * * * * *").Key
.Buttons("ProceduralLoss").ToolTipText = " Procedural Loss "
With .Buttons("ProceduralLoss")
.ButtonMenus.Add , "Log", "Error Log"
.ButtonMenus("Log").Parent = Me.Toolbar1.Buttons("ProceduralLoss")
.ButtonMenus.Add , "Definitions", "Definitions"
.ButtonMenus("Definitions").Parent = Me.Toolbar1.Buttons("ProceduralLoss")
End With
.Buttons.Add , "Accident", , tbrDefault, imgTool.ListImages("Accident").Key
.Buttons("Accident").ToolTipText = " Accident "
.Buttons.Add , "Alarms", , tbrDefault, imgTool.ListImages("Alarms").Key
.Buttons("Alarms").ToolTipText = " Alarm Tests "
.Buttons.Add , , , tbrPlaceholder
.Buttons.Add , "Branches", , tbrDefault, imgTool.ListImages("Branch").Key
.Buttons("Branches").ToolTipText = " Branches/Cost Centers "
.Buttons.Add , "People", , tbrDefault, imgTool.ListImages("Person").Key
.Buttons("People").ToolTipText = " People "
.Buttons.Add , "Tellers", , tbrDefault, imgTool.ListImages("Tellers").Key
.Buttons("Tellers").ToolTipText = " Tellers "
.Buttons.Add , , , tbrPlaceholder
.Buttons.Add , "Reports", , tbrDefault, imgTool.ListImages("Reports").Key
.Buttons("Reports").ToolTipText = " Reports "
.Buttons.Add , , , tbrPlaceholder
.Buttons.Add , "Options", , tbrDropdown, imgTool.ListImages("Options").Key
With .Buttons("Options")
.ToolTipText = " Options "
.ButtonMenus.Add , "Appearance", "Appearance"
.ButtonMenus.Add , "Paths", "File Paths"
.ButtonMenus.Add , "Printing", "Printing"
End With
.Buttons.Add , , , tbrPlaceholder
.Buttons.Add , "Exit", , tbrDefault, imgTool.ListImages("Exit").Key
.Buttons("Exit").ToolTipText = " Exit "
End With

MikeJ
04-06-2003, 09:34 PM
You can also right click on the toolbar, click Properties, and add buttons that way. It is a little better than all of this code. (Of course, to put the images with them, you need an image list.)

Hope this helps,
~MikeJ

futura
04-07-2003, 03:08 AM
You can also right click on the toolbar, click Properties, and add buttons that way. It is a little better than all of this code. (Of course, to put the images with them, you need an image list.)

Hope this helps,
~MikeJ

Thanks a lot.

:)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum