Creating a Toolbar

To create a tool bar

  1. Draw the ActiveBar 3.0 control onto your form.
  2. 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.
  3. Right-click the Categories node in the ActiveBar Designer tree view and select Insert.
  4. Select the new category and press the F2 key to rename the category Tools.
  5. 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.
  6. Change the Name, Caption, and ID properties for each of the tools.
  7. Create an Others category and add a Separator tool to it.
  8. 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.
  9. Press the Apply button and the band appears on your form.
  10. 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.
  11. 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.
  12. 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.
  13. Click the OK button to return to the form.
  14. Double-click the toolbar to go to the code view and create the ActiveBar31_ToolClick event.
  15. Paste the select statement into the ToolClick event.
  16. Add code corresponding to the appropriate tools into the generated select case statement.
  17. 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.