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. Windows Forms
  4. DropDownButton

DropDownButton

Scheduled Pinned Locked Moved Windows Forms
questionhelptutorial
2 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.
  • A Offline
    A Offline
    Askold
    wrote on last edited by
    #1

    Hi All! Please help, How to create DropDownButton in WindowsForms application? I do not want to use ToolStripBar with ToolStripDropDownButton. I would inherit from class Button but what is the best way to implement drop down functional? Thank you!

    A 1 Reply Last reply
    0
    • A Askold

      Hi All! Please help, How to create DropDownButton in WindowsForms application? I do not want to use ToolStripBar with ToolStripDropDownButton. I would inherit from class Button but what is the best way to implement drop down functional? Thank you!

      A Offline
      A Offline
      Alan Burkhart
      wrote on last edited by
      #2

      Suggestion: Using most any paint program, create a very small arrow similar to the one in most drop down buttons. Create it pointing down and save it, then flip it vertically and save it again under a different name. Now you have your up and down arrows for the button. Drag a regular button onto your form and set the text. Add the down arrow, aligned to the right of the text. Create a ContextMenuStrip for the button and add the desired items. Write code so that when the button is clicked once, the button's image changes to the up arrow, and the context menu appears below the button. Next time it's clicked, reset the button image back to the down arrow and close the context menu. You can monitor the button's "state" with a boolean variable and the menu's Visible property. Also, add a line of code to each event handler in the context menu so that the button's image changes back to the down arrow when a menu item is clicked - since the menu will close. Not a perfect solution, but I did something similar with ActionScript a few years ago and it worked quite well. Best AB

      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