ComboBox lock/suppress DropDown
-
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;
-
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;
--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.
-
--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'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;
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 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.
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;
-
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;