Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to code toolbar panels.

how to code toolbar panels.

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HinJinShah
    wrote on last edited by
    #1

    Dear friends, i wanted to know that how can i write code behind toolbar panels.. when eevr i double click on toolbar it takes me to buttonclick event of toolbar.. but how can i code behind the buttons i placed upon toolbar?

    S 1 Reply Last reply
    0
    • H HinJinShah

      Dear friends, i wanted to know that how can i write code behind toolbar panels.. when eevr i double click on toolbar it takes me to buttonclick event of toolbar.. but how can i code behind the buttons i placed upon toolbar?

      S Offline
      S Offline
      SerialHobbyist
      wrote on last edited by
      #2

      When you click on a toolbar, the toolbar's ButtonClick event is fired and the button that was click is passed in ToolBarButtonClickEventArgs - its button property contains the index of the button (from the Buttons collection). You could deal with it using a: Select Case yourToolBarName.Buttons.IndexOf (e.Button) for example.

      H 1 Reply Last reply
      0
      • S SerialHobbyist

        When you click on a toolbar, the toolbar's ButtonClick event is fired and the button that was click is passed in ToolBarButtonClickEventArgs - its button property contains the index of the button (from the Buttons collection). You could deal with it using a: Select Case yourToolBarName.Buttons.IndexOf (e.Button) for example.

        H Offline
        H Offline
        HinJinShah
        wrote on last edited by
        #3

        thank you sir with this help.. but do i always need to use Select Case for dealing with Buttons of ToolBar.. can you please send me a lil code snipper for this.. thank you

        S 1 Reply Last reply
        0
        • H HinJinShah

          thank you sir with this help.. but do i always need to use Select Case for dealing with Buttons of ToolBar.. can you please send me a lil code snipper for this.. thank you

          S Offline
          S Offline
          SerialHobbyist
          wrote on last edited by
          #4

          No, you could use If...End If. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmSelectCase.asp I've assumed an Open button, a Save button and a SaveAs button. For the Open button, I've pointed it at what might be the routine you've already written to handle a traditional menu item called mnuFileOpen. Select Case toolbar.Buttons.IndexOf(e.button) Case 0 mnuFileOpen_Click(Nothing, Nothing) Case 1 SaveFile() Case 2 SaveFileAs() Case Else ' Other values. 'Since you should know how many buttons you've got, you shouldn't 'need a Case Else. End Select Don't forget that if you've used separators, they'll be on this list. E.g. If you have a separator after the Open button, you should code: Case 1 Case 2 SaveFile() etc.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups