PC Review


Reply
Thread Tools Rate Thread

ComboBoxes in vb.net

 
 
Ryan McConnell
Guest
Posts: n/a
 
      25th Feb 2004


Hi,
I have Two string arrays and several questions...
I want to populate a combobox with the contents of both of the arrays.

Is there a way, like in classic asp/html, where i can have a value for
the label and one for the actual value. like in a select:-
<option value="val">Value Displayed</option>

I want to display the name from one array and use the corresponding
value from another as the value.


Also, i've noticed that when i add things to a combobox there is no
initially selected value. is it possible to show a different option at
the start?

Thanks
Ryan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Richard T. Edwards@pwpsquared.net
Guest
Posts: n/a
 
      25th Feb 2004
this.value & " " & ValueDisplayed???

"Ryan McConnell" <(E-Mail Removed)> wrote in message
news:ezZcm8z%(E-Mail Removed)...
>
>
> Hi,
> I have Two string arrays and several questions...
> I want to populate a combobox with the contents of both of the arrays.
>
> Is there a way, like in classic asp/html, where i can have a value for
> the label and one for the actual value. like in a select:-
> <option value="val">Value Displayed</option>
>
> I want to display the name from one array and use the corresponding
> value from another as the value.
>
>
> Also, i've noticed that when i add things to a combobox there is no
> initially selected value. is it possible to show a different option at
> the start?
>
> Thanks
> Ryan
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      25th Feb 2004
Hi Ryan,

You can, but you have you use one array of objects or a datatable for it.

I prefer for that to use a datatable with 2 columns, because it is so easy
to make
You can that do
mycombobox.datasource = mytable
mycombobox.displaymember = mycolumn1
mycombobox.valuemember = mycolmn2

The selectedvalue is set by the mycombobox.selectedindex=y

(If you want a simple example how to make a datatable message that back than
i give it to you)

I hope this helps?

Cor

> Hi,
> I have Two string arrays and several questions...
> I want to populate a combobox with the contents of both of the arrays.
>
> Is there a way, like in classic asp/html, where i can have a value for
> the label and one for the actual value. like in a select:-
> <option value="val">Value Displayed</option>
>
> I want to display the name from one array and use the corresponding
> value from another as the value.
>
>
> Also, i've noticed that when i add things to a combobox there is no
> initially selected value. is it possible to show a different option at
> the start?



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
COMBOBOXES Zigball Microsoft Excel Programming 1 19th Dec 2006 01:10 AM
3 COMBOBOXES =?Utf-8?B?c21pbGV5?= Microsoft Excel Crashes 0 10th Oct 2005 05:12 PM
Comboboxes =?Utf-8?B?RGFycmVu?= Microsoft Excel Programming 1 23rd Jan 2005 05:35 PM
ComboBoxes =?Utf-8?B?QmlsbA==?= Microsoft VB .NET 0 20th Feb 2004 03:56 PM
ComboBoxes =?Utf-8?B?Smlt?= Microsoft VB .NET 1 16th Feb 2004 03:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:33 PM.