473,657 Members | 2,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox - many on form, all get text highlighted?

I have a windows form, many combo boxes, i create items and add to the items
collection in code. When viewing form, many combos have their text
selected, highlighted. Is there a preferred way to pre-select the first
item in a combo without highlighting text all the time? I am using
Combo.SelectedI ndex = 0; after populating the items collection.

Thanks in advance!

Derrick
Nov 16 '05 #1
2 5980
you can use DropDownStyle -> DropDownList

but if you need DropDownStyle -> DropDown use:
cboL.SelectionS tart
cboL.SelectionL ength

MajorTom

"Derrick" <de*********@ex cite.com> wrote in message
news:Op******** ******@TK2MSFTN GP12.phx.gbl...
I have a windows form, many combo boxes, i create items and add to the items collection in code. When viewing form, many combos have their text
selected, highlighted. Is there a preferred way to pre-select the first
item in a combo without highlighting text all the time? I am using
Combo.SelectedI ndex = 0; after populating the items collection.

Thanks in advance!

Derrick

Nov 16 '05 #2
That did it, thanks!!

Derrick

"MajorTom" <m.******@veriz on.net.do> wrote in message
news:Oc******** ********@TK2MSF TNGP11.phx.gbl. ..
you can use DropDownStyle -> DropDownList

but if you need DropDownStyle -> DropDown use:
cboL.SelectionS tart
cboL.SelectionL ength

MajorTom

"Derrick" <de*********@ex cite.com> wrote in message
news:Op******** ******@TK2MSFTN GP12.phx.gbl...
I have a windows form, many combo boxes, i create items and add to the

items
collection in code. When viewing form, many combos have their text
selected, highlighted. Is there a preferred way to pre-select the first
item in a combo without highlighting text all the time? I am using
Combo.SelectedI ndex = 0; after populating the items collection.

Thanks in advance!

Derrick


Nov 16 '05 #3

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

Similar topics

2
1820
by: Julian Jordan | last post by:
Hi I'm trying to write a system in which you can highlight some text in a form box, click a button (or press a key combination) and the text highlighted gets surrounded by a given html tag. The following works fine in IE on a PC: txt = document.selection.createRange().text;
4
9104
by: Beeeeeeeeeeeeves | last post by:
I have an ownerdrawn combo box which I am drawing with an image and some text, this is all working beautifully apart from the difference in the Brush I have to draw the background and the text with if the item is the currently selected one. I have selected a blue (SystemColors.Highlight) background brush and white (SystemColors.HighlightText) text brush if the item is the highlighted one, but when I do that instead of functioning like a...
1
1631
by: Beeeeeeeeeeeeves | last post by:
I have an ownerdrawn combo box which I am drawing with an image and some text, this is all working beautifully apart from the difference in the Brush I have to draw the background and the text with if the item is the currently selected one. I have selected a blue (SystemColors.Highlight) background brush and white (SystemColors.HighlightText) text brush if the item is the highlighted one, but when I do that instead of functioning like a...
4
7635
by: genojoe | last post by:
I have the following code: .cboBox1.Items.AddRange(New Object() {"A", "B", "C"}) .cboBox2.Items.AddRange(New Object() {"A", "B", "C"}) .cboBox6.Items.AddRange(New Object() {"A", "B", "C"}) .cboBox1.SelectedIndex = 0 .cboBox2.SelectedIndex = 1 .cboBox6.SelectedIndex = 2 When this form opens, A, B, and C are all highlighted in their respective controls. I have tried the following ways to unhighlight the text but without success.
6
2873
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the data table. The lookup
3
2018
by: njuneardave | last post by:
Hey, Here is a quick question: I have two forms that I am using, and I need to highlight the text in Form1 by clicking and dragging (obviously). So, when I switch to Form2 (making it the focused form), I want to still be able to see the highlighted text in Form1 even though the form is not focused. When I click back to Form1, I see the highlighted text, but if I focus Form2, I don't see the highlighted text. Is there a way that I can...
1
1260
grs5211
by: grs5211 | last post by:
Visual Studio 2005 on XP sp2 ComboBox events I have a simple comboBox that is bound to some data. While stepping down the list I want to be able to show a little popup with supplimental information related to the row highlighted as it changes. Moving the mouse, or arrow Up/Down to the next row "BLUE ROAN" will show it's relevant data in the textbox. This is moving the highlighted row only. There is no click or selected event yet. I...
1
5194
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hello I've created a .NET 2.0 form and added 6 text boxes, 1 combo box and 2 button controls. The combo box has a DropDownStyle of DropDown, so the user can still type in the combo box. The combo box has the follows values in it's drop down list: "Dear Sir,"
9
4166
by: somacore | last post by:
I have a winform with a combobox. This combobox's text is set to a value from the database (in this case, a number). In my code I take the number and convert it to the proper text, returning the value as the selecteditem for the combobox. This part works. However, if I try to UPDATE the value in the combobox at runtime, I am able to select the new value, but after that I cannot do anything. I am unable to select any other element on my form...
0
8310
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
8827
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...
1
8503
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
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6167
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
5632
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();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2731
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
1957
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.