Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleUse the CoolBar control with various controls
KeywordsCoolBar, toolbar
CategoriesControls
 
This is not as easy as it should be. CoolBar controls contain Band objects that represent the groupings of things in the CoolBar. Right-click the CoolBar and select Properties to manage the Bands. Each Band can hold only one child control. You will probably want that child to be some other container control so it can hold more than one thing itself.

Start by creating the CoolBar at design time. Create its child inside the CoolBar. Do this just as you would place a control inside any other container such as a Frame or PictureBox.

You can right click on the CoolBar and select the child into a Band at design time, or you can set a Band's Child property at run time.

In this example, the CoolBar has 2 bands. The first contains a ComboBox. The second contains a PictureBox with BorderStyle = 0 - None. The PictureBox contains several other controls. All of these controls were placed in the CoolBar and assigned to Bands at design time.

When the program begins, it centers the controls vertically inside the PictureBox.

 
Private Sub CenterControl(ByVal ctl As Control)
    ctl.Top = (Picture1.ScaleHeight - ctl.Height) / 2
End Sub

Private Sub Form_Load()
    CenterControl Label1
    CenterControl Text1
    CenterControl Option1(0)
    CenterControl Option1(1)
    CenterControl Check1
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated