PC Review


Reply
Thread Tools Rate Thread

ReadOnly ComboBox

 
 
=?Utf-8?B?RGljaw==?=
Guest
Posts: n/a
 
      5th Apr 2005
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?
 
Reply With Quote
 
 
 
 
Floyd Burger
Guest
Posts: n/a
 
      5th Apr 2005
set the DropDownStyle to DropDownList. That will only let you select one of
the items that is in the list.

--
Floyd

"Dick" <(E-Mail Removed)> wrote in message
news:1B977BCE-729A-45E7-B2AA-(E-Mail Removed)...
> 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?



 
Reply With Quote
 
 
 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      6th Apr 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.

 
Reply With Quote
 
Claudio Grazioli
Guest
Posts: n/a
 
      6th Apr 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/PermaLin...0-62e4cd3b7281

hth
--
Claudio Grazioli
http://www.grazioli.ch
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel WB opened from Sharepoint as ReadOnly, ReadONLY for WB = FAL Barb Reinhardt Microsoft Excel Programming 0 19th Jan 2010 11:44 PM
datagridviewcolumn.readonly not really readonly boo@gmail.com Microsoft VB .NET 0 31st May 2007 01:42 AM
ReadOnly ComboBox Dan Microsoft ADO .NET 3 4th Mar 2004 12:47 PM
Textbox readonly -> but not with readonly property Milosz - [playseven.com] Microsoft Dot NET Compact Framework 3 1st Mar 2004 01:27 PM
Thoughts on readonly collection of readonly elements emma middlebrook Microsoft C# .NET 0 11th Jan 2004 07:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 AM.