Results 1 to 5 of 5

Thread: toolbar problem [ RESOLVED ]

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Dgte. City
    Posts
    45

    Question toolbar problem [ RESOLVED ]

    hi,

    i have added a toolbar on my form, also i added buttons in the toolbar. how will i determine which button the user clicks?

    the only event it will go wen i double click on the toolbar button is the toolbar_click event. it does not have any event for the specify toolbar button. how can i solve this one?

    thanks in advance...
    Last edited by Mark_V; May 20th, 2004 at 02:37 AM.
    Mark_V

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I typed this off memory so don't blame me if I'm wrong , It should be like this

    VB Code:
    1. select case e.index
    2.  
    3. case 0 'button 1
    4. .
    5. .
    6.  
    7. case 1'button 2
    8. .
    9. .
    10.  
    11. end select

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I believe its actually e.Button to access the button that was clicked but its the same concept as what Pirate was saying.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This is how it should be done ,
    VB Code:
    1. Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object,
    2. ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs)
    3. Handles ToolBar1.ButtonClick
    4.  
    5.         Select Case e.Button.Text
    6.             Case "OK"
    7.  
    8.             Case "Save"
    9.  
    10.             Case "Exit"
    11.  
    12.         End Select
    13.  
    14.     End Sub

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2002
    Location
    Dgte. City
    Posts
    45
    thanks....
    Mark_V

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