StrataFrame Forum

Prevent User from opening combobox....

http://forum.strataframe.net/Topic8552.aspx

By StarkMike - 4/27/2007

How would I prevent the user from opening a combo box? Lets say that I want to check a condition first and if the condition is true allow them to open it... if its false prevent them from opening it.



Thanks
By StrataFrame Team - 4/27/2007

You could always set the ComboBox.Enabled = false Wink

But something tells me that's not what you want to do.  There's not a way to prevent it from happening, but when it happens, you can immidiately hide it by handling the DropDown event of the combo.  If the condition is false, then immidiately set the DroppedDown property to False.  There isn't a Close() method or I would recommend it, but the DroppedDown seems to do the same thing.

By StarkMike - 4/27/2007

Thats what I ended up doing Hehe programmatically setting the Enabled property.

I was just looking for an event so that I could inform the user why I was preventing them from opening the combo. Smile