CoolBar.frm

 VERSION 5.00
Object = "{38911DA0-E448-11D0-84A3-00DD01104159}#1.1#0"; "COMCT332.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmCoolBar
   Caption         =   "CoolBar Control Demo"
   ClientHeight    =   1830
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   7095
   Icon            =   "CoolBar.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   1830
   ScaleWidth      =   7095
   StartUpPosition =   3  'Windows Default
   Begin MSComctlLib.ImageList ImageList3
      Left            =   1770
      Top             =   1140
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
         NumListImages   =   2
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":030A
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":0466
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageList2
      Left            =   1050
      Top             =   1140
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   20
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
         NumListImages   =   7
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":05C2
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":0B1E
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":107A
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":15D6
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":1B32
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":208E
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":25EA
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageList1
      Left            =   420
      Top             =   1140
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   20
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
         NumListImages   =   7
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":2B46
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":30A2
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":35FE
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":3B5A
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":40B6
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":4612
            Key             =   ""
         EndProperty
         BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
            Picture         =   "CoolBar.frx":4B6E
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin ComCtl3.CoolBar CoolBar1
      Align           =   1  'Align Top
      Height          =   1050
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   1852
      BandCount       =   6
      FixedOrder      =   -1  'True
      _CBWidth        =   7095
      _CBHeight       =   1050
      _Version        =   "6.0.8450"
      Child1          =   "Toolbar1"
      MinHeight1      =   600
      Width1          =   2235
      BandPicture1    =   "CoolBar.frx":50CA
      FixedBackground1=   0   'False
      NewRow1         =   0   'False
      BandEmbossPicture1=   -1  'True
      Child2          =   "Combo1"
      MinHeight2      =   315
      Width2          =   4995
      FixedBackground2=   0   'False
      NewRow2         =   -1  'True
      Caption3        =   "Band 3"
      MinHeight3      =   360
      BandPicture3    =   "CoolBar.frx":541C
      FixedBackground3=   0   'False
      NewRow3         =   0   'False
      AllowVertical3  =   0   'False
      Caption4        =   "Band 4"
      MinHeight4      =   360
      FixedBackground4=   0   'False
      NewRow4         =   0   'False
      AllowVertical4  =   0   'False
      Caption5        =   "Band 5"
      MinHeight5      =   360
      NewRow5         =   0   'False
      AllowVertical5  =   0   'False
      Caption6        =   "Band 6"
      MinHeight6      =   360
      NewRow6         =   0   'False
      AllowVertical6  =   0   'False
      Begin VB.ComboBox Combo1
         Height          =   315
         Left            =   165
         TabIndex        =   2
         Top             =   675
         Width           =   3900
      End
      Begin MSComctlLib.Toolbar Toolbar1
         Height          =   600
         Left            =   30
         TabIndex        =   1
         Top             =   30
         Width           =   6975
         _ExtentX        =   12303
         _ExtentY        =   1058
         ButtonWidth     =   1191
         ButtonHeight    =   1058
         Wrappable       =   0   'False
         Style           =   1
         ImageList       =   "ImageList1"
         DisabledImageList=   "ImageList1"
         HotImageList    =   "ImageList2"
         _Version        =   393216
         BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
            NumButtons      =   5
            BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
               Caption         =   "Back"
               Description     =   "Back"
               Object.Tag             =   "Back"
               ImageIndex      =   1
            EndProperty
            BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
               Caption         =   "Forward"
               Description     =   "Forward"
               Object.Tag             =   "Forward"
               ImageIndex      =   2
            EndProperty
            BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
               Caption         =   "Stop"
               Description     =   "Stop"
               Object.Tag             =   "Stop"
               ImageIndex      =   3
            EndProperty
            BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
               Caption         =   "Refresh"
               Description     =   "Refresh"
               Object.Tag             =   "Refresh"
               ImageIndex      =   4
            EndProperty
            BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
               Caption         =   "Home"
               Description     =   "Home"
               Object.Tag             =   "Home"
               ImageIndex      =   5
            EndProperty
         EndProperty
      End
   End
End
Attribute VB_Name = "frmCoolBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' CoolBar.frm
'
' By Herman Liu
'
' A demonstration of using Coolbar Control.
'
' CoolBar Control (MSComCtl.Ocx) is a container control for creating user-configurable
' toolbars similar to those seen in IE.  It consists of a collection of resizable regions
' known as bands. CoolBar Control differs to other ActiveX controls in certain areas: (1)
' Adding a control to a band: e.g. you may put a Toolbar control in the 1st band & another
' in the 2nd band.  You may remove or add bands to the defaulted three bands. (2) Setting
' property values to Coolbar: You invoke its Properties page. In its Bands tab, select an
' index.  You may of course leave some property values to be set at run time, e.g. to have
' the 4th band on a new row, you would code "Coolbar1.Bands(4).NewRow=True".
'
' After building a Coolbar, you set property values of individual controls in each band
' as usual.
'
' Each band can only host one control.  If one wants to emulate multiple child controls on
' a single band, one has to use a container control, such as a PictureBox.
'
' Note that CoolBar can only host controls which expose a Window handle, hence lightweight
' controls such as Label,Image,and Shape can't be used. (Although you can place them on
' CoolBar, they won't appear at run time and won't be listed in the Child list box on the
' Property Page).
'
' Some controls contained in a CoolBar may not behave as expected, e.g. a Toolbar would not
' paint properly, if its Wrappable property is set to True and the CoolBar is resized.
'
' The Band object has an Image property which can be used to display an icon to the right
' of the move handle.
'



Private Sub Form_Load()
    Dim I
      ' See remarks at top
    Toolbar1.Wrappable = False
   
      ' Add a caption to 2nd band
    CoolBar1.Bands(2).Caption = "Address:"
   
      ' We want 4 bands to show up only, hence remove the rest.
    I = 4
    Do While CoolBar1.Bands.Count > I
        CoolBar1.Bands.Remove (I + 1)
    Loop
   
      ' Additional image(s) to Toolbar.  You may of course clear all buttons first
      ' with Toolbar1.Buttons.Clear and then loop through all images in ImageList1.
    Set Toolbar1.ImageList = ImageList1
    Set Toolbar1.HotImageList = ImageList2
    Toolbar1.Buttons.Add , ImageList1.ListImages(6).Key, ImageList1.ListImages(6).Tag, , 6
    Toolbar1.Buttons(6).Caption = "Favorites"
    Toolbar1.Buttons.Add , ImageList1.ListImages(7).Key, ImageList1.ListImages(7).Tag, , 7
    Toolbar1.Buttons(7).Caption = "Search"
   
      ' Add image(s) to band(s)
    Set CoolBar1.ImageList = ImageList3
    CoolBar1.Bands(3).Image = 1
    CoolBar1.Bands(4).Image = 2
   
      ' Change a caption
    CoolBar1.Bands(3).Caption = "Changed Caption"
End Sub



Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    MsgBox Button.Caption & " clicked"
End Sub


Private Sub Form_Unload(Cancel As Integer)
    End
End Sub


Project Homepage: