Click here to Skip to main content
15,664,618 members
Home / Discussions / C#
   

C#

 
GeneralRe: When to define interfaces Pin
leppie24-Sep-02 4:01
leppie24-Sep-02 4:01 
GeneralRe: When to define interfaces Pin
Paul Riley24-Sep-02 4:18
Paul Riley24-Sep-02 4:18 
GeneralRe: When to define interfaces Pin
Paul Riley24-Sep-02 4:12
Paul Riley24-Sep-02 4:12 
GeneralRe: When to define interfaces Pin
Stephane Rodriguez.24-Sep-02 4:54
Stephane Rodriguez.24-Sep-02 4:54 
GeneralRe: When to define interfaces Pin
Paul Riley24-Sep-02 5:04
Paul Riley24-Sep-02 5:04 
GeneralThread in C# Pin
D Shen23-Sep-02 8:33
D Shen23-Sep-02 8:33 
General.NET ComboBox Item Tags (SetItemData equivalent) Pin
Gaul23-Sep-02 7:40
Gaul23-Sep-02 7:40 
GeneralRe: .NET ComboBox Item Tags (SetItemData equivalent) Pin
leppie23-Sep-02 8:15
leppie23-Sep-02 8:15 
Hi
Do this:

public class ComboBoxItem 
{
  object tag = null;
  string text = null;
  
  public ComboBoxItem(string text)
  {
    this.text = text;
  }
  public object Tag {get {return tag;} set {tag = value;}}
  
  public override string ToString(){return text;}
}


Now just add these objects to ComboBox.Items. ie

comboBox1.Items.Add( new ComboBoxItem("some text"));


You can set/get the tags via:

object tag = ((ComboBoxItem) comboBox1.Items[i]).Tag; //note cast. [edit] oops made a mistake, correct now :)[/edit]


Hope this helps Smile | :)

Give them a chance! Do it for the kittens, dear God, the kittens!
GeneralRe: .NET ComboBox Item Tags (SetItemData equivalent) Pin
Gaul23-Sep-02 9:20
Gaul23-Sep-02 9:20 
GeneralRe: .NET ComboBox Item Tags (SetItemData equivalent) Pin
leppie23-Sep-02 10:18
leppie23-Sep-02 10:18 
GeneralRe: .NET ComboBox Item Tags (SetItemData equivalent) Pin
James T. Johnson23-Sep-02 17:30
James T. Johnson23-Sep-02 17:30 
Generaloutlook add-in event handler doesn't work Pin
derhackler23-Sep-02 4:25
derhackler23-Sep-02 4:25 
GeneralRe: outlook add-in event handler doesn't work Pin
leppie23-Sep-02 5:04
leppie23-Sep-02 5:04 
GeneralRe: outlook add-in event handler doesn't work Pin
derhackler23-Sep-02 5:44
derhackler23-Sep-02 5:44 
GeneralRe: outlook add-in event handler doesn't work Pin
leppie23-Sep-02 5:56
leppie23-Sep-02 5:56 
GeneralRe: outlook add-in event handler doesn't work Pin
derhackler27-Sep-02 5:29
derhackler27-Sep-02 5:29 
GeneralCustom collection and Properties window Pin
Maciej Pirog23-Sep-02 3:43
Maciej Pirog23-Sep-02 3:43 
GeneralRe: Custom collection and Properties window Pin
leppie23-Sep-02 5:51
leppie23-Sep-02 5:51 
GeneralRe: Custom collection and Properties window Pin
Maciej Pirog25-Sep-02 7:53
Maciej Pirog25-Sep-02 7:53 
GeneralRe: Custom collection and Properties window Pin
leppie25-Sep-02 9:18
leppie25-Sep-02 9:18 
GeneralRe: Custom collection and Properties window Pin
Maciej Pirog26-Sep-02 4:50
Maciej Pirog26-Sep-02 4:50 
QuestionHow to convert object to user define type by a typename string? Pin
Winona22-Sep-02 20:26
Winona22-Sep-02 20:26 
AnswerRe: How to convert object to user define type by a typename string? Pin
Stephane Rodriguez.22-Sep-02 21:27
Stephane Rodriguez.22-Sep-02 21:27 
AnswerRe: How to convert object to user define type by a typename string? Pin
James T. Johnson22-Sep-02 21:30
James T. Johnson22-Sep-02 21:30 
GeneralRe: How to convert object to user define type by a typename string? Pin
Winona23-Sep-02 20:15
Winona23-Sep-02 20:15 

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.