PC Review


Reply
Thread Tools Rate Thread

Combobox - ReadOnly

 
 
chris in grimsby
Guest
Posts: n/a
 
      30th Mar 2004
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)
 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      30th Mar 2004
Hi Chris,

Is this not easier?

dropdownstyle, makes it readonly

http://msdn.microsoft.com/library/de...styletopic.asp

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      30th Mar 2004
Chris,

chris in grimsby schrieb:
> 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 [MVP]
<URL:http://dotnet.mvps.org/>

 
Reply With Quote
 
chris in grimsby
Guest
Posts: n/a
 
      31st Mar 2004
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Chris,
>
> chris in grimsby schrieb:
> > 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.


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)
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      31st Mar 2004
Hi Chris,

Did you look at that link I have send?

Cor


 
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
ReadOnly ComboBox =?Utf-8?B?RGljaw==?= Microsoft Dot NET Framework Forms 3 6th Apr 2005 07:29 AM
comboBox -> readonly Dino L. Microsoft C# .NET 4 26th Oct 2004 01:23 PM
Readonly comboBox? ISMAILRAJPUT Microsoft C# .NET 1 28th Apr 2004 11:08 PM
ReadOnly ComboBox Dan Microsoft ADO .NET 3 4th Mar 2004 11:47 AM
Combobox readonly. =?Utf-8?B?SmVzcGVy?= Microsoft C# .NET 1 3rd Feb 2004 01:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 AM.