Um, This is what I think you are trying to do. You have a combobox called
cboDPI. You want the text in the box to display the first item in the list.
You are populating the list with strings. If this is what you are trying to
do, then this is the code you need in the form load event.
cboDPI.Items.Add("audi")
cboDPI.Items.Add("buick")
cboDPI.Items.Add("chevy")
cboDPI.Items.Add("ford")
cboDPI.SelectedIndex = 0
now audi will show up as the selecteditem. If you want to read that item
later in code do:
MessageBox.Show(CStr(cboDPI.SelectedItem))
Good Luck
Chris
"VB User" <VB****@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
ComboBox1.Text = ComboBox1.Items(0).ToString
cboDPI.SelectedIndex = 0
Both these statements don't work. Any help?
"Chris" wrote:
Can you show the code you are using to "read" the selected item?
you need to use combobox1.selecteditem and then read your string from
there.
chris
"VB User" <VB****@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com... > Is there some other property I should set. Setting Selected Index does
> not
> help. It simply reads the text property I set during design time.
>
>
> "vvenk" wrote:
>
>> Set the Combo Box's Selected Index to 0 in the formload event.
>>
>> Venkat
>>
>> "VB User" wrote:
>>
>> > I would like the text property of combo box to read the first item
>> > of
>> > the
>> > list on form load. I have a set of four items in the collection.
>> > How do I do it?
>> > Thanks
>> >