Board index » Visual Studio » Help with DataCombo.Text!

Help with DataCombo.Text!

Visual Studio195
Hi,



I have a datacombo which holds a list of dates i.e.

02/01/2006

01/01/2006

31/12/2005



I would like the datacombo.text to display the first record in the datacombo

i.e. 02/01/2006 without having to actually select it from the lost. Is this

possible?



Appreciate the help



Thanks



Damon


-
 

Re:Help with DataCombo.Text!

Why don't you use a standard combo set to the dropdown list style? It isn't

hard to populate a combo with code.





"Damon" <nonsense@nononsense.com>wrote in message

Quote
Hi,



I have a datacombo which holds a list of dates i.e.

02/01/2006

01/01/2006

31/12/2005



I would like the datacombo.text to display the first record in the

datacombo i.e. 02/01/2006 without having to actually select it from the

lost. Is this possible?



Appreciate the help



Thanks



Damon







-

Re:Help with DataCombo.Text!

I have used a standard combo instead but how can I display the last item in

the list as the combobox.text?



Appreciate the help.



"David J Mark" <nntp45534-22@newsdesk.net>wrote in message

Quote
Why don't you use a standard combo set to the dropdown list style? It

isn't hard to populate a combo with code.





"Damon" <nonsense@nononsense.com>wrote in message

news:chLyf.7266$C7.5129@newsfe3-win.ntli.net...

>Hi,

>

>I have a datacombo which holds a list of dates i.e.

>02/01/2006

>01/01/2006

>31/12/2005

>

>I would like the datacombo.text to display the first record in the

>datacombo i.e. 02/01/2006 without having to actually select it from the

>lost. Is this possible?

>

>Appreciate the help

>

>Thanks

>

>Damon

>









-

Re:Help with DataCombo.Text!

Quote
I have used a standard combo instead but

how can I display the last item in the list

as the combobox.text?



The ListIndex property is used to select (and read) an item in the list via

code. For your question, this line will do what you want...



Combo1.ListIndex = Combo1.ListCount - 1



Rick





-