473,811 Members | 3,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a ComboBox ReadOnly?

I want to have a ComboBox that is loaded programmically not except keyboard
inputs.

I tried in KeyDown not calling MyBase.OnKeyDow n(e)
and also tried setting e.Handled = True but neither appear to suppress the
keyboard input.
Any suggestions I could try will be appreciated

Nov 21 '05 #1
3 8094
By readonly I mean, I don't want the user adding text in the textbox. The
values in the DropDown are the only allowed values.

For example the dropDown values might be the US state names, and one of
these must be selected - no other values allowed.
Thanks

" **Developer**" <RE************ *@a-znet.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
I want to have a ComboBox that is loaded programmically not except keyboard
inputs.

I tried in KeyDown not calling MyBase.OnKeyDow n(e)
and also tried setting e.Handled = True but neither appear to suppress the
keyboard input.
Any suggestions I could try will be appreciated

Nov 21 '05 #2
Developer,

You can set the combobox's DropDownStyle property to DropDownList to have
the combobox behave like a dropdown listbox.

Kerry Moorman
"**Develope r**" wrote:
By readonly I mean, I don't want the user adding text in the textbox. The
values in the DropDown are the only allowed values.

For example the dropDown values might be the US state names, and one of
these must be selected - no other values allowed.
Thanks

" **Developer**" <RE************ *@a-znet.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
I want to have a ComboBox that is loaded programmically not except keyboard
inputs.

I tried in KeyDown not calling MyBase.OnKeyDow n(e)
and also tried setting e.Handled = True but neither appear to suppress the
keyboard input.
Any suggestions I could try will be appreciated


Nov 21 '05 #3
I did check the style an even tried something - I don't remember the name of
the style- but it wasn't OK. I must have missed DropDownList.

Thanks for the help!

"Kerry Moorman" <Ke**********@d iscussions.micr osoft.com> wrote in message
news:7B******** *************** ***********@mic rosoft.com...
Developer,

You can set the combobox's DropDownStyle property to DropDownList to have
the combobox behave like a dropdown listbox.

Kerry Moorman
"**Develope r**" wrote:
By readonly I mean, I don't want the user adding text in the textbox. The
values in the DropDown are the only allowed values.

For example the dropDown values might be the US state names, and one of
these must be selected - no other values allowed.
Thanks

" **Developer**" <RE************ *@a-znet.com> wrote in message
news:u$******** ******@TK2MSFTN GP10.phx.gbl...
>I want to have a ComboBox that is loaded programmically not except
>keyboard
>inputs.
>
> I tried in KeyDown not calling MyBase.OnKeyDow n(e)
> and also tried setting e.Handled = True but neither appear to suppress
> the
> keyboard input.
>
>
> Any suggestions I could try will be appreciated
>
>
>


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3065
by: Mendhak | last post by:
Hi All, When you add an object to a combobox, and run the application, you'll get something like this: System.Windows.Forms.Button, Text: Button1 (for example). Is it possible to have just the text/value in the object to be displayed in
3
4278
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found several examples on the web. They all seem to have problems, though that I've been unable to resolve. The most promising example I have found is at:
1
42504
by: cashdeskmac | last post by:
I have a combobox which contains the different departments at my work place. However, if the user types another name into the combobox, it is accepted. I wish to allow only the names already associated with the control. Also, how can I set the control so that the user can type, for example, the letter "M" and it takes them to the first instance, which is manager? Visual Studio has no readonly property in the properties window, and doesn't...
5
4311
by: malcolm | last post by:
I'm trying to make a combo box custom control (Windows Forms .NET 1.1 c#) that can behave like a label programatically at run time. This is actually a strong feature request by our customers. I really don't want to have to make a UserControl that has both a label and ComboBox in it. I would rather have my control derive from a ComboBox for databinding (and other) reasons. I can get close, I've tried setting cbo.DropDownStyle =...
2
4340
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
3
6838
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article: http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx I have a problem when there are two DataGrid's on one form, and when I switch focus from one grid to the other. To be more precise, when I'm editing a combo box column in one grid, and then click in the combo column of...
6
10533
by: Roberto | last post by:
Hi, using vb 2005 I'd like to have a combobox in READONLY mode, like I have for textbox. Combobox only has enabled property. When I turn this property false I can not select the text in the combo. Has anyone solved this problem? Thanks
1
2101
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this works. The first set of code I downloaded from internet and when i tried it, it worked fine. But when I changed the second part of the code it started to give me trouble. Before I changed the code they used Datacolumns,Datarows and Datatables and...
1
1786
by: Kevin | last post by:
I've modified a combobox class so that it has a ReadOnly property. When set to ReadOnly, the combobox can't be changed, but it doesn't appear gray. I called the new class ComboLockBox and I've placed them on a MDIChild form and they work great. The problem is, I got a timer that looks for mouse activity and when the mouse is idle for a set number of minutes, all MDIChild forms are hidden and the Logon form is displayed. When the user...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9211
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7673
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4346
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.