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 lock/suppress DropDown

ComboBox lock/suppress DropDown

Scheduled Pinned Locked Moved C#
help
6 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.
  • I Offline
    I Offline
    Ian
    wrote on last edited by
    #1

    I have a control that is derived from the standard ComboBox. I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control. This is related to another post that I have out there for a custom OnPaint event. I want to provide custom colors for ComboBox that work even when the Enabled is set to false (by default it is set to Gray). I have provided a new implementation for the Enabled property to handle it myself. When the control is in my disabled state I am supressing KeyDowns so that it appears as if it is disabled. The only problem is that you can still drop down the list, and choose an item. If I can lock this, I'm good to go. Oh, and I'd rather not have to use SendMessage in WndProc to accomplish this. I don't want to have a dependency on user32.dll. --Ian;

    N 1 Reply Last reply
    0
    • I Ian

      I have a control that is derived from the standard ComboBox. I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control. This is related to another post that I have out there for a custom OnPaint event. I want to provide custom colors for ComboBox that work even when the Enabled is set to false (by default it is set to Gray). I have provided a new implementation for the Enabled property to handle it myself. When the control is in my disabled state I am supressing KeyDowns so that it appears as if it is disabled. The only problem is that you can still drop down the list, and choose an item. If I can lock this, I'm good to go. Oh, and I'd rather not have to use SendMessage in WndProc to accomplish this. I don't want to have a dependency on user32.dll. --Ian;

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      --Ian wrote:

      I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control.

      Sound like a textbox with an image of an arrow next to it.

      I 1 Reply Last reply
      0
      • N Not Active

        --Ian wrote:

        I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control.

        Sound like a textbox with an image of an arrow next to it.

        I Offline
        I Offline
        Ian
        wrote on last edited by
        #3

        I'd also not like to reinvent the wheel. Everything else the ComboBox does is great, I just want to lock the drop down list from being dropped down. --Ian;

        N 1 Reply Last reply
        0
        • I Ian

          I'd also not like to reinvent the wheel. Everything else the ComboBox does is great, I just want to lock the drop down list from being dropped down. --Ian;

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          I guess I don't understand. A dropdown without being able to dropdown is not a dropdown. A rose by any other name would be a textbox.

          I 1 Reply Last reply
          0
          • N Not Active

            I guess I don't understand. A dropdown without being able to dropdown is not a dropdown. A rose by any other name would be a textbox.

            I Offline
            I Offline
            Ian
            wrote on last edited by
            #5

            The problem is that I need a dropdown with my own custom Enabled property. When I disable it, I want to lock or suppress the dropdown list from being displayed. In other words, this rose must still be a dropdown. Once again, the root cause for this is that the BackColor is set to Gray when the ComboBox is diabled by setting Enabled = false. The OnPaint event is creating other issues, as expressed in another post, and I'm looking for another workaround. --Ian;

            V 1 Reply Last reply
            0
            • I Ian

              The problem is that I need a dropdown with my own custom Enabled property. When I disable it, I want to lock or suppress the dropdown list from being displayed. In other words, this rose must still be a dropdown. Once again, the root cause for this is that the BackColor is set to Gray when the ComboBox is diabled by setting Enabled = false. The OnPaint event is creating other issues, as expressed in another post, and I'm looking for another workaround. --Ian;

              V Offline
              V Offline
              VB 8 0
              wrote on last edited by
              #6

              Hi CP, May i know anyone get the things ? Regards ,

              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