Re: Fill a ComboBox
From: Scott (scottaf_at_yahoo.com)
Date: 02/17/04
- Next message: Miha Markic [MVP C#]: "Re: Sorting a Strong Typed Dataset"
- Previous message: Miha Markic [MVP C#]: "Re: Fill a ComboBox"
- In reply to: Pepehammer: "Fill a ComboBox"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Feb 2004 14:51:29 -0600
A simple way is to create a class to hold your data. The combobox uses the
System.Windows.Forms.ComboBox.ObjectCollection class to hold the items for
the combobox and uses the ToString() method to get the text to display.
Simply create a class that has a String and an Integer and add a ToString()
method to return the String value.
See this previous newsgroup post...
"Pepehammer" <pepehammer@hotmail.com> wrote in message
news:OMRMrQZ9DHA.3404@TK2MSFTNGP09.phx.gbl...
> Hi everybody!
>
> I got a combobox to fill.
> I want to display some information (Text), but when I select a item, I
want
> to return a number.
>
> The info I want to fill in is something like this:
>
> TEXT VALUE
> Category1 10
> Category2 15
> Category3 35
>
> How can I perform this task?
>
> Thanks!
>
>
>
>
>
- Next message: Miha Markic [MVP C#]: "Re: Sorting a Strong Typed Dataset"
- Previous message: Miha Markic [MVP C#]: "Re: Fill a ComboBox"
- In reply to: Pepehammer: "Fill a ComboBox"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|