Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

ReadOnly ComboBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dick - 05 Apr 2005 19:03 GMT
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?
Floyd Burger - 05 Apr 2005 19:45 GMT
set the DropDownStyle to DropDownList.  That will only let you select one of
the items that is in the list.

Signature

Floyd

> 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?
"Jeffrey Tan[MSFT]" - 06 Apr 2005 07:03 GMT
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
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Claudio Grazioli - 06 Apr 2005 07:29 GMT
> 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
Signature

Claudio Grazioli
http://www.grazioli.ch


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.