Combobox - ReadOnly

  • Thread starter Thread starter chris in grimsby
  • Start date Start date
C

chris in grimsby

I need to make a combobox that acts like a textbox with "readonly" set
to true.

VB6 combo box had a nice property of "Locked" which meant that the
control could get focus and could be dropped down, but not changed.
The vb.NET textbox control has a "readonly" property that means the
control can get focus, but does not accept user input.
The "Enabled" property does not allow the control to get focus, so
that is no good.

I intend to create a new control, inheriting the vb.net combobox
control. I will add a property "ReadOnly".
How do I filter the user events that I want the control to process and
dismiss those that I dont want.
or is there a simpler way to do this?

If it helps any, the combobox will be only used as a dropdown list
(can't type into it)
 
Chris,
I need to make a combobox that acts like a textbox with "readonly" set
to true.

Maybe setting the control's 'DropDownStyle' to 'DropDownList' helps.
 
Herfried K. Wagner said:
Chris,


Maybe setting the control's 'DropDownStyle' to 'DropDownList' helps.

Sorry, Im not makking myself clear. My controll is DropDownList style.
I want to allow the control to get focus, but prevent the user from
changing the selected item (read only - not changable by the user)
 
Back
Top