Click here to Skip to main content
16,004,919 members
Home / Discussions / C#
   

C#

 
JokeRe: How to get the date now C# Pin
Clickok8-Jul-07 9:04
Clickok8-Jul-07 9:04 
GeneralRe: How to get the date now C# Pin
Synaptrik8-Jul-07 9:18
Synaptrik8-Jul-07 9:18 
QuestionCells merging in datagridview control - how? Pin
israeli8-Jul-07 4:22
israeli8-Jul-07 4:22 
AnswerRe: Cells merging in datagridview control - how? Pin
Not Active8-Jul-07 5:44
mentorNot Active8-Jul-07 5:44 
QuestionAdding tag or euivenlt to combobox item? Pin
liqnit8-Jul-07 2:29
liqnit8-Jul-07 2:29 
AnswerRe: Adding tag or euivenlt to combobox item? Pin
Luc Pattyn8-Jul-07 2:38
sitebuilderLuc Pattyn8-Jul-07 2:38 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
liqnit8-Jul-07 3:00
liqnit8-Jul-07 3:00 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
Luc Pattyn8-Jul-07 3:38
sitebuilderLuc Pattyn8-Jul-07 3:38 
Good news, you dont need OwnerDraw, it suffices to provide a ToString() method.
Example:

// the item class:
class cbi {
	public int i;
	public string text;
	public cbi(int i, string text) { this.i=i; this.text=text; }
	public override string ToString() { return text+" "+i; }
}

// inside the Form class:
public Form1() {
	InitializeComponent();
	cb.Items.Add(new cbi(1, "a"));
	cb.Items.Add(new cbi(2, "b"));
	cb.Items.Add(new cbi(3, "c"));
	cb.SelectedIndexChanged+=new EventHandler(cb_SelectedIndexChanged);
}
 
void log(string s) {Console.WriteLine(s);}
 
void cb_SelectedIndexChanged(object sender, EventArgs e) {
	cbi item=(cbi)cb.SelectedItem;
	// now you can access any member/property of item:
	if(item==null) log("item=null");
	else log("item i="+item.i);
}


Smile | :)




AnswerRe: Adding tag or euivenlt to combobox item? Pin
Christian Graus8-Jul-07 3:17
protectorChristian Graus8-Jul-07 3:17 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
liqnit8-Jul-07 3:31
liqnit8-Jul-07 3:31 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
Luc Pattyn8-Jul-07 3:48
sitebuilderLuc Pattyn8-Jul-07 3:48 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
liqnit8-Jul-07 4:01
liqnit8-Jul-07 4:01 
GeneralRe: Adding tag or euivenlt to combobox item? Pin
Luc Pattyn8-Jul-07 4:16
sitebuilderLuc Pattyn8-Jul-07 4:16 
Questionfind files with folder browser Pin
ytubis8-Jul-07 2:03
ytubis8-Jul-07 2:03 
AnswerRe: find files with folder browser Pin
mav.northwind8-Jul-07 2:40
mav.northwind8-Jul-07 2:40 
QuestionHow to use "SELECT .... WHERE .... LIKE..." Pin
Muhammad Gouda8-Jul-07 1:56
Muhammad Gouda8-Jul-07 1:56 
AnswerRe: How to use "SELECT .... WHERE .... LIKE..." Pin
mav.northwind8-Jul-07 2:38
mav.northwind8-Jul-07 2:38 
GeneralRe: How to use "SELECT .... WHERE .... LIKE..." Pin
Muhammad Gouda8-Jul-07 2:51
Muhammad Gouda8-Jul-07 2:51 
AnswerRe: How to Empty the DataSet Pin
Vikram A Punathambekar8-Jul-07 1:28
Vikram A Punathambekar8-Jul-07 1:28 
JokeRe: How to Empty the DataSet Pin
Muhammad Gouda8-Jul-07 1:50
Muhammad Gouda8-Jul-07 1:50 
GeneralRe: How to Empty the DataSet Pin
Vikram A Punathambekar8-Jul-07 4:48
Vikram A Punathambekar8-Jul-07 4:48 
QuestionOpen XML (Rss) file. Pin
jafingi8-Jul-07 1:11
jafingi8-Jul-07 1:11 
QuestionSQL Server Express connection problems Pin
sgeorgije7-Jul-07 22:46
sgeorgije7-Jul-07 22:46 
AnswerRe: SQL Server Express connection problems Pin
mav.northwind7-Jul-07 23:02
mav.northwind7-Jul-07 23:02 
GeneralRe: SQL Server Express connection problems Pin
sgeorgije8-Jul-07 1:00
sgeorgije8-Jul-07 1:00 

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.