Results 1 to 2 of 2

Thread: Coding the different buttons in a standard toolbar

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Posts
    2

    Question

    Where do you find information on coding the different buttons on a toolbar. For instance a button that centers one line of text (maybe a Title) rather than the whole document. I have been searching the internet and help files in vb but there is very little in the way of actual coding when it comes to each individual button. Can anyone get me on the right track?

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    This is from a project i was recently working on

    Code:
    Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
        
        '-----------------------------------------------------'
        'This sub deals with a click on any of the tool bar   '
        'buttons.  We differentiate between buttons with the  '
        'Key property of the button that has been clicked     '
        '-----------------------------------------------------'
        
        On Error GoTo toolBarError
        
        Select Case Button.Key
          Case Is = "Edit"
            edit_View_Mode (False)
          Case Is = "View"
            edit_View_Mode (True)
          Case Is = "Tariff"
            mnuViewTariff_Click
          Case Is = "Products"
            If goto_Selected_Screen("products", Me) = True Then
              frmProducts.Show , frmTreeView
            End If
          
          Case Is = "Back"
            moveBackScreen
        End Select
        
        Exit Sub
        
    toolBarError:
        Dim lResult As Long
        
        lResult = formsErrorHandler("ToolBar Error :")
    
    End Sub
    Iain, thats with an i by the way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width