Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: System.Windows.Forms.TextBox and WM_CTLCOLOREDIT Pin
Rama Krishna Vavilala5-Aug-02 10:18
Rama Krishna Vavilala5-Aug-02 10:18 
GeneralTextBoxes - custom stuff Pin
Nish Nishant4-Aug-02 21:35
sitebuilderNish Nishant4-Aug-02 21:35 
GeneralRe: TextBoxes - custom stuff [more...] Pin
Nish Nishant4-Aug-02 21:39
sitebuilderNish Nishant4-Aug-02 21:39 
GeneralRe: TextBoxes - custom stuff Pin
Rama Krishna Vavilala5-Aug-02 7:29
Rama Krishna Vavilala5-Aug-02 7:29 
GeneralCEdit::SetMargins equivalent in .NET Pin
Nish Nishant4-Aug-02 20:49
sitebuilderNish Nishant4-Aug-02 20:49 
GeneralRe: CEdit::SetMargins equivalent in .NET Pin
Nish Nishant4-Aug-02 21:09
sitebuilderNish Nishant4-Aug-02 21:09 
GeneralTag for ComboBox items Pin
Luis Alonso Ramos4-Aug-02 19:14
Luis Alonso Ramos4-Aug-02 19:14 
GeneralRe: Tag for ComboBox items Pin
James T. Johnson4-Aug-02 19:54
James T. Johnson4-Aug-02 19:54 
The value displayed in a combobox (by default) is obtained by calling ToString() on the item in question.

So the simple answer is to write a class that has your two values and make the ToString() method return the string value.

The better answer is to make the ID and readable name values into properties. Then you can set the DisplayMember and ValueMember properties on the ComboBox to the names of the properties in your class and retreive the value by examining the SelectedValue property to tell which value is selected.

HTH,

James
"Java is free - and worth every penny." - Christian Graus
GeneralRe: Tag for ComboBox items Pin
Luis Alonso Ramos5-Aug-02 5:12
Luis Alonso Ramos5-Aug-02 5:12 
GeneralFilter out non-standard fonts Pin
Nish Nishant4-Aug-02 14:53
sitebuilderNish Nishant4-Aug-02 14:53 
GeneralTrueType OpenType Pin
Nish Nishant4-Aug-02 14:47
sitebuilderNish Nishant4-Aug-02 14:47 
GeneralRe: TrueType OpenType Pin
Domenic Denicola4-Aug-02 17:32
Domenic Denicola4-Aug-02 17:32 
GeneralForce Scroll in DataGrid Pin
MStanbrook4-Aug-02 14:01
MStanbrook4-Aug-02 14:01 
GeneralRe: Force Scroll in DataGrid Pin
James T. Johnson4-Aug-02 21:28
James T. Johnson4-Aug-02 21:28 
GeneralRe: Force Scroll in DataGrid Pin
mike.5-Aug-02 8:15
mike.5-Aug-02 8:15 
GeneralMarshaling Pin
Kastro4-Aug-02 10:52
Kastro4-Aug-02 10:52 
GeneralRe: Marshaling Pin
Rama Krishna Vavilala4-Aug-02 11:18
Rama Krishna Vavilala4-Aug-02 11:18 
GeneralRe: Marshaling Pin
Kastro4-Aug-02 11:29
Kastro4-Aug-02 11:29 
GeneralRe: Marshaling Pin
Rama Krishna Vavilala4-Aug-02 11:32
Rama Krishna Vavilala4-Aug-02 11:32 
GeneralRe: Marshaling Pin
Kastro4-Aug-02 11:42
Kastro4-Aug-02 11:42 
GeneralRe: Marshaling Pin
Rama Krishna Vavilala4-Aug-02 11:44
Rama Krishna Vavilala4-Aug-02 11:44 
GeneralRe: Marshaling Pin
Kastro4-Aug-02 11:52
Kastro4-Aug-02 11:52 
GeneralRe: Marshaling Pin
Rama Krishna Vavilala4-Aug-02 12:01
Rama Krishna Vavilala4-Aug-02 12:01 
GeneralRe: Marshaling Pin
Kastro4-Aug-02 12:03
Kastro4-Aug-02 12:03 
GeneralRe: Marshaling Pin
James T. Johnson4-Aug-02 13:23
James T. Johnson4-Aug-02 13:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.