home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / design / toolba / toolbar.txt < prev    next >
Text File  |  1995-02-27  |  1KB  |  44 lines

  1. Option Explicit
  2. Dim ToolBarButtons() As ToolbarButtonType
  3.  
  4. Sub Form_Load ()
  5.    PictToolBar.ScaleMode = 3          ' Pixel
  6.    PictToolBar.ScaleHeight = 28       ' Hoehe der Toolbar
  7.    ReDim ToolBarButtons(0)
  8. End Sub
  9.  
  10. Sub MnuSub_Click (index As Integer)
  11.    On Error Resume Next
  12.    Select Case index
  13.    Case 1
  14.        Dim ToolBarsCount As Integer
  15.        ToolBarsCount = UBound(ToolBarButtons) + 1
  16.        ReDim Preserve ToolBarButtons(ToolBarsCount)
  17.        ToolbarAddButton PictToolBar, ToolBarButtons(ToolBarsCount), ToolBarsCount * 24, ToolBarsCount, PictBitmaps
  18.    Case 2
  19.        ToolBarHideButton PictToolBar, ToolBarButtons(2), PictBitmaps
  20.    Case 3
  21.        ToolBarGrayButton PictToolBar, ToolBarButtons(3), PictBitmaps
  22.    Case Else
  23.       Unload Me
  24.    End Select
  25. End Sub
  26.  
  27. Sub PictToolBar_Click ()
  28.    '
  29.    '
  30.    '
  31.    Dim ButtonNr As Integer
  32.    ButtonNr = ToolBarGetClicked(PictToolBar, ToolBarButtons())
  33.    If ButtonNr > 0 Then MsgBox "Hi, there was then " + Str(ButtonNr) + " Button Clicked)"
  34. End Sub
  35.  
  36. Sub PictToolBar_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
  37.     ToolBarMousedown PictToolBar, ToolBarButtons(), x, y, PictBitmaps
  38. End Sub
  39.  
  40. Sub PictToolBar_MouseUp (Button As Integer, Shift As Integer, x As Single, y As Single)
  41.    ToolBarMouseUp PictToolBar, ToolBarButtons(), x, y, PictBitmaps
  42. End Sub
  43.  
  44.