To create a tool bar
- Draw the ActiveBar 3.0 control onto your form.
- Open the ActiveBar 3.0 Designer by right-clicking the ActiveBar control
in the form and selecting Properties in the context menu or by
double-clicking the ellipsis
to the
right of the Custom property in the properties list.
- Right-click the Categories node in the ActiveBar Designer tree view and
select Insert.
- Select the new category and press the F2 key to rename
the category Tools.
- Right-click the Tools category and select tools from the context menu
for your new toolbar. The tools you select appear under the newly created
category.
- Change the Name, Caption, and
ID properties for each of the tools.
- Create an Others category and add a Separator tool to it.
- Right-click the Bands node in the Designer and select Tool Bar
from the context menu to add a toolbar to the Band node. A Toolbar menu
icon appears in the Bands node.
- Press the Apply button and the band appears on your
form.
- Double-click the icon for each tool under the category node to display
the Icon Editor. If needed, review the Icon
Editor topic for further guidance. Create an icon in the Icon Editor
window using the Icon Editor tools, or capture an icon using the Icon
capture tool.
- Drag the tools from the Tools category into the Toolbar band. You can
drag the tools one at a time or press the CTRL or SHIFT key while
selecting them to select multiple tools.
- Click the Create Select Case Statement icon
in
the Designer toolbar to automatically generate a select case statement
using the tools you have created for your toolbar.
- Click the OK button to return to the form.
- Double-click the toolbar to go to the code view and create the
ActiveBar31_ToolClick event.
- Paste the select statement into the ToolClick
event.
- Add code corresponding to the appropriate tools into the generated
select case statement.
- Save and run your application.
To add a tool bar at run time
Add an ActiveBar control to your form and add the following code to the
Form_Load event of your form.
Private Sub Form_Load()
' Instantiate the band object.
Dim standardBand As ActiveBar3LibraryCtl.Band
' Add a band named "standardToolbar" to the Activebar
' bands Collection and display the Band on the form.
Set standardBand = ActiveBar31.Bands.Add("standardToolbar")
' Set the band type.
standardBand.Type = ddBTNormal
' Switch on the Stretch flag enabling
' the Band to fill all the space with in the dockline.
standardBand.Flags = ddBFStretch
End Sub
Toolbar Band | Floating Toolbar | Walkthrough: Single Document Interface | Walkthrough: Multiple Document Interface
Copyright © 2006 Data Dynamics, Ltd. All Rights Reserved.