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. Closing a dropdown box on a toolstrip item

Closing a dropdown box on a toolstrip item

Scheduled Pinned Locked Moved Windows Forms
csharpquestion
6 Posts 3 Posters 3 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.
  • M Offline
    M Offline
    Member 9804689
    wrote on last edited by
    #1

    Hello, Sometimes coding in C#, you can't see the forest for the trees. I'm sure the answer is ridiculously simple, but it has me baffled. On a windows form, the user clicks a toolstrip item which opend a dropdown list. The user clicks a selection, dropdown list disappears, and the selected item displays towards the top. To get rid of that displayed item, you have to click anywhere else on the form. All I'm trying to do is when the user clicks their selection, close (wrong word?)down the display for that toolstrip item. (Act as if I clicked on a different portion of the form.) Thanks in advance.

    R X 2 Replies Last reply
    0
    • M Member 9804689

      Hello, Sometimes coding in C#, you can't see the forest for the trees. I'm sure the answer is ridiculously simple, but it has me baffled. On a windows form, the user clicks a toolstrip item which opend a dropdown list. The user clicks a selection, dropdown list disappears, and the selected item displays towards the top. To get rid of that displayed item, you have to click anywhere else on the form. All I'm trying to do is when the user clicks their selection, close (wrong word?)down the display for that toolstrip item. (Act as if I clicked on a different portion of the form.) Thanks in advance.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      You could try selecting another control by doing theControl.Select(). /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      M 2 Replies Last reply
      0
      • R Ravi Bhavnani

        You could try selecting another control by doing theControl.Select(). /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        M Offline
        M Offline
        Member 9804689
        wrote on last edited by
        #3

        Thanks Ravi, but I get the same results. Researching the problem, it's comforting to know that I am not the only one experiencing this problem. Other users experiencing the same problem seem to report "it doesn't work" to other offered solutions. I found an old post with an answer by a Microsoft employee stating, "It's by design." Well even so . . . Kevin

        1 Reply Last reply
        0
        • R Ravi Bhavnani

          You could try selecting another control by doing theControl.Select(). /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          M Offline
          M Offline
          Member 9804689
          wrote on last edited by
          #4

          Ravi, My apologies. I'm unfamiliar with this messsage board and I hit a "down arrow" icon thinking it would scroll down to the next message. Turns out it gave you a thumbs down for your answer, which was definitely not my intention. - Kevin

          R 1 Reply Last reply
          0
          • M Member 9804689

            Ravi, My apologies. I'm unfamiliar with this messsage board and I hit a "down arrow" icon thinking it would scroll down to the next message. Turns out it gave you a thumbs down for your answer, which was definitely not my intention. - Kevin

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            No worries. :-D /ravi

            My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

            1 Reply Last reply
            0
            • M Member 9804689

              Hello, Sometimes coding in C#, you can't see the forest for the trees. I'm sure the answer is ridiculously simple, but it has me baffled. On a windows form, the user clicks a toolstrip item which opend a dropdown list. The user clicks a selection, dropdown list disappears, and the selected item displays towards the top. To get rid of that displayed item, you have to click anywhere else on the form. All I'm trying to do is when the user clicks their selection, close (wrong word?)down the display for that toolstrip item. (Act as if I clicked on a different portion of the form.) Thanks in advance.

              X Offline
              X Offline
              xstoneheartx
              wrote on last edited by
              #6

              If I understood your question correctly, you have a ToolStripComboBox as an item of a ToolStripDropDownButton and want to close dropdown when an item of combobox is selected; so you can do this:

              private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
              {
              ((ToolStripItem)sender).PerformClick();
              }

              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