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. C#
  4. combobox problem

combobox problem

Scheduled Pinned Locked Moved C#
helpquestionannouncement
5 Posts 3 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
    akkram
    wrote on last edited by
    #1

    Hi im using a combobox which is populated with a fairly large amount of items (no databind). The problem im having is that sometimes when I expand the combobox it wont stay open as it should so I can scroll down/up through the items, instead it closes as soon as you release the mouse button. Anyone have any idea to why this is happening? /thanks

    M N 2 Replies Last reply
    0
    • A akkram

      Hi im using a combobox which is populated with a fairly large amount of items (no databind). The problem im having is that sometimes when I expand the combobox it wont stay open as it should so I can scroll down/up through the items, instead it closes as soon as you release the mouse button. Anyone have any idea to why this is happening? /thanks

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, One possibility is that you move the mouse outside the Controls area, while the mouse button is pressed. If you than release the button, the items are still all visible! This is per design! You could make a workaround like this. private void comboBox1_MouseLeave(object sender, System.EventArgs e) { if(this.comboBox1.DroppedDown) this.comboBox1.DroppedDown = false; } Or inherit your own combobox, and override OnMouseLeave.

      All the best, Martin

      A 1 Reply Last reply
      0
      • M Martin 0

        Hello, One possibility is that you move the mouse outside the Controls area, while the mouse button is pressed. If you than release the button, the items are still all visible! This is per design! You could make a workaround like this. private void comboBox1_MouseLeave(object sender, System.EventArgs e) { if(this.comboBox1.DroppedDown) this.comboBox1.DroppedDown = false; } Or inherit your own combobox, and override OnMouseLeave.

        All the best, Martin

        A Offline
        A Offline
        akkram
        wrote on last edited by
        #3

        Hmm sorry to say, but that is not the case. The combobox opens on mouse down and closes on mouse up even though the pointer never leves the combobox control area.

        M 1 Reply Last reply
        0
        • A akkram

          Hmm sorry to say, but that is not the case. The combobox opens on mouse down and closes on mouse up even though the pointer never leves the combobox control area.

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          idqfizz wrote:

          even though the pointer never leves the combobox control area

          YEP, I never said something else! (I hope so) What I meant is, that you sometimes leave the area (as a mistake), and than you have this effect!

          All the best, Martin

          1 Reply Last reply
          0
          • A akkram

            Hi im using a combobox which is populated with a fairly large amount of items (no databind). The problem im having is that sometimes when I expand the combobox it wont stay open as it should so I can scroll down/up through the items, instead it closes as soon as you release the mouse button. Anyone have any idea to why this is happening? /thanks

            N Offline
            N Offline
            Nisar Inamdar
            wrote on last edited by
            #5

            Hi frnd, you have to give the code, So that i can help u...:cool: Nisar Inamdar.

            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