473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

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.SelectedIndex = 0; after populating the items collection.

Thanks in advance!

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

but if you need DropDownStyle -> DropDown use:
cboL.SelectionStart
cboL.SelectionLength

MajorTom

"Derrick" <de*********@excite.com> wrote in message
news:Op**************@TK2MSFTNGP12.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.SelectedIndex = 0; after populating the items collection.

Thanks in advance!

Derrick

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

Derrick

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

but if you need DropDownStyle -> DropDown use:
cboL.SelectionStart
cboL.SelectionLength

MajorTom

"Derrick" <de*********@excite.com> wrote in message
news:Op**************@TK2MSFTNGP12.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.SelectedIndex = 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
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. ...
4
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...
1
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...
4
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"})...
6
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...
3
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...
1
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...
1
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. ...
9
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.