Is there an easy (i.e. without creating a new control) way to make a ComboBox
ReadOnly such that the user can't change its value but doesn't have to strain
their eyes to read its greyed out text?

Re: ReadOnly ComboBox by Floyd

Floyd
Tue Apr 05 13:45:55 CDT 2005

set the DropDownStyle to DropDownList. That will only let you select one of
the items that is in the list.

--
Floyd

"Dick" <Richard.Giles@nospam.nospam> wrote in message
news:1B977BCE-729A-45E7-B2AA-952E3F8F6657@microsoft.com...
> Is there an easy (i.e. without creating a new control) way to make a
> ComboBox
> ReadOnly such that the user can't change its value but doesn't have to
> strain
> their eyes to read its greyed out text?



RE: ReadOnly ComboBox by v-jetan

v-jetan
Wed Apr 06 01:03:48 CDT 2005

Hi Richard,

Thanks for your post!!

If you want to prevent the user from modifying item in the "textbox" of
combobox and still want the dropdown behavior, you may follow Floyd's
suggestion of changing combobox's style from DropDownStyle to
DropDownList.

If you want to disable both content modify and dropdown behavior, I think
you may use a readonly textbox to replace combobox control.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Re: ReadOnly ComboBox by Claudio

Claudio
Wed Apr 06 01:29:03 CDT 2005

On Tue, 5 Apr 2005 11:03:02 -0700, Dick wrote:

> Is there an easy (i.e. without creating a new control) way to make a ComboBox
> ReadOnly such that the user can't change its value but doesn't have to strain
> their eyes to read its greyed out text?

Dick,

As Jeffrey suggests, you may use a ReadOnly textbox control, while
ReadOnly. If you want to go this way, you can use my own ReadOnlyComboBox
which encapsulates that behavior. It has a ReadOnly property and as soon as
you set it to true, it displays a ReadOnly texbox instead of the combobox.
When you set it back to false, it displays again the ComboBox.

You can download it from my blog:
http://www.grazioli.ch/Blog/PermaLink.aspx?guid=696e467f-5f8c-40f2-8270-62e4cd3b7281

hth
--
Claudio Grazioli
http://www.grazioli.ch