Click here to Skip to main content
15,909,939 members
Home / Discussions / C#
   

C#

 
Generalcaputring a textbox Pin
Anonymous4-Jun-05 9:21
Anonymous4-Jun-05 9:21 
GeneralRe: caputring a textbox Pin
MoustafaS4-Jun-05 11:38
MoustafaS4-Jun-05 11:38 
GeneralRe: caputring a textbox Pin
eggie54-Jun-05 11:51
eggie54-Jun-05 11:51 
Generalforeign windows: position and size of minimize button Pin
FreeClimber4-Jun-05 9:18
FreeClimber4-Jun-05 9:18 
GeneralCombobox - Add Object's name property, not Object's name Pin
Seraphin4-Jun-05 7:35
Seraphin4-Jun-05 7:35 
GeneralRe: Combobox - Add Object's name property, not Object's name Pin
Carsten Zeumer4-Jun-05 7:42
Carsten Zeumer4-Jun-05 7:42 
GeneralRe: Combobox - Add Object's name property, not Object's name Pin
Seraphin4-Jun-05 8:10
Seraphin4-Jun-05 8:10 
GeneralRe: Combobox - Add Object's name property, not Object's name Pin
Carsten Zeumer4-Jun-05 8:21
Carsten Zeumer4-Jun-05 8:21 
No, you do not!
You add the object and the Combobox uses the to String method of the items to display a text.
Try this:
<code>
private void Form1_Load(object sender, System.EventArgs e)
{
	this.comboBox1.Items.Add(new Person());
	foreach(object o in this.comboBox1.Items)
		MessageBox.Show(String.Format("Item is of type {0} and is the persons name is {1}",o.GetType().FullName, (o is Person) ? ((Person)o).Name : "not a person") );
}


it works fine in my test.

/cadi

24 hours is not enough
GeneralRe: Combobox - Add Object's name property, not Object's name Pin
DavidNohejl4-Jun-05 8:21
DavidNohejl4-Jun-05 8:21 
GeneralRe: Combobox - Add Object's name property, not Object's name Pin
Seraphin4-Jun-05 8:33
Seraphin4-Jun-05 8:33 
Generaltable-level topological sort problem Pin
erdsah884-Jun-05 5:28
erdsah884-Jun-05 5:28 
GeneralXML Manipulation Pin
Member 17843034-Jun-05 3:44
Member 17843034-Jun-05 3:44 
GeneralSelecting directory and file together from OpenFileDialog Pin
Anonymous4-Jun-05 3:15
Anonymous4-Jun-05 3:15 
GeneralChanging name of &quot;Open&quot; button in OpenFileDialog Pin
Anonymous4-Jun-05 3:10
Anonymous4-Jun-05 3:10 
GeneralRe: Changing name of &quot;Open&quot; button in OpenFileDialog Pin
Dario Solera4-Jun-05 4:07
Dario Solera4-Jun-05 4:07 
GeneralRe: Changing name of &quot;Open&quot; button in OpenFileDialog Pin
MoustafaS4-Jun-05 4:18
MoustafaS4-Jun-05 4:18 
GeneralRe: Changing name of &quot;Open&quot; button in OpenFileDialog Pin
Andy Moore6-Jun-05 7:58
Andy Moore6-Jun-05 7:58 
QuestionHow to update value in Hashtable Pin
Member 20184464-Jun-05 0:09
Member 20184464-Jun-05 0:09 
AnswerRe: How to update value in Hashtable Pin
Colin Angus Mackay4-Jun-05 0:22
Colin Angus Mackay4-Jun-05 0:22 
GeneralDoubt regarding usage of 'this' Pin
manivannan.p3-Jun-05 23:54
manivannan.p3-Jun-05 23:54 
GeneralRe: Doubt regarding usage of 'this' Pin
S. Senthil Kumar4-Jun-05 0:06
S. Senthil Kumar4-Jun-05 0:06 
GeneralRe: Doubt regarding usage of 'this' Pin
WillemM4-Jun-05 0:08
WillemM4-Jun-05 0:08 
GeneralRe: Doubt regarding usage of 'this' Pin
Colin Angus Mackay4-Jun-05 0:21
Colin Angus Mackay4-Jun-05 0:21 
GeneralRe: Doubt regarding usage of 'this' Pin
Carsten Zeumer4-Jun-05 7:50
Carsten Zeumer4-Jun-05 7:50 
GeneralRe: Doubt regarding usage of 'this' Pin
Scott Serl4-Jun-05 12:08
Scott Serl4-Jun-05 12:08 

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.