Click here to Skip to main content
15,896,153 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to replace a control in designer ? Pin
leppie18-Mar-06 19:30
leppie18-Mar-06 19:30 
GeneralRe: How to replace a control in designer ? Pin
chloh18-Mar-06 20:26
chloh18-Mar-06 20:26 
QuestionHow to write a flat menu and toolbar like VS2005? Pin
Newlad18-Mar-06 17:47
Newlad18-Mar-06 17:47 
AnswerRe: How to write a flat menu and toolbar like VS2005? Pin
Ravi Bhavnani18-Mar-06 17:57
professionalRavi Bhavnani18-Mar-06 17:57 
QuestionGUI Similare Musicmatch, itune or Windows Media Manager. Pin
temp555618-Mar-06 17:27
temp555618-Mar-06 17:27 
AnswerRe: GUI Similare Musicmatch, itune or Windows Media Manager. Pin
Ravi Bhavnani18-Mar-06 18:01
professionalRavi Bhavnani18-Mar-06 18:01 
AnswerAlso... Pin
Ravi Bhavnani18-Mar-06 18:07
professionalRavi Bhavnani18-Mar-06 18:07 
QuestionSimple question(i hope) about ComboBox Pin
e-laj18-Mar-06 11:24
e-laj18-Mar-06 11:24 
i have the folowing class:

class MyClass<br />
{<br />
	public MyClass(string str)<br />
	{<br />
		Str = str;<br />
	}<br />
<br />
	public string Str;<br />
<br />
	public override string ToString()<br />
	{<br />
		return Str;<br />
	}<br />
}


now lets add some items to a ComboBox:

comboBox1.Items.Add(new MyClass("aaa"));<br />
comboBox1.Items.Add(new MyClass("bbb"));<br />
comboBox1.Items.Add(new MyClass("ccc"));


and now....
suppose that i want to change the first item Str member to "ddd":
the following line doesn't work:

((MyClass)comboBox1.Items[0]).Str = "ddd";

But the following will work:

comboBox1.Items[0] = new MyClass("ddd");

It seems that a copy of the item is returned from the object collection in the ComboBox.
Does anyone know how it is possible to change the item directly without replacing it?

Thanks in advanced, Ilan
AnswerRe: Simple question(i hope) about ComboBox Pin
Ed.Poore18-Mar-06 12:49
Ed.Poore18-Mar-06 12:49 
GeneralRe: Simple question(i hope) about ComboBox Pin
e-laj18-Mar-06 13:25
e-laj18-Mar-06 13:25 
AnswerRe: Simple question(i hope) about ComboBox Pin
Guffa18-Mar-06 14:19
Guffa18-Mar-06 14:19 
GeneralRe: Simple question(i hope) about ComboBox Pin
e-laj18-Mar-06 14:31
e-laj18-Mar-06 14:31 
GeneralRe: Simple question(i hope) about ComboBox Pin
Ed.Poore18-Mar-06 22:26
Ed.Poore18-Mar-06 22:26 
GeneralRe: Simple question(i hope) about ComboBox Pin
e-laj19-Mar-06 2:57
e-laj19-Mar-06 2:57 
GeneralRe: Simple question(i hope) about ComboBox Pin
e-laj19-Mar-06 3:21
e-laj19-Mar-06 3:21 
GeneralRe: Simple question(i hope) about ComboBox Pin
Ed.Poore19-Mar-06 7:08
Ed.Poore19-Mar-06 7:08 
QuestionVirtual Network Adapter Pin
atmearman18-Mar-06 10:37
atmearman18-Mar-06 10:37 
AnswerRe: Virtual Network Adapter Pin
Ed.Poore18-Mar-06 11:03
Ed.Poore18-Mar-06 11:03 
GeneralRe: Virtual Network Adapter Pin
atmearman18-Mar-06 12:18
atmearman18-Mar-06 12:18 
GeneralRe: Virtual Network Adapter Pin
Ed.Poore18-Mar-06 12:43
Ed.Poore18-Mar-06 12:43 
Questionhow to show image in millimeters? Pin
valiovalio18-Mar-06 10:35
valiovalio18-Mar-06 10:35 
QuestionFile Upload using WebClient c# Pin
shamsallana18-Mar-06 10:28
shamsallana18-Mar-06 10:28 
AnswerRe: File Upload using WebClient c# Pin
Ed.Poore18-Mar-06 10:50
Ed.Poore18-Mar-06 10:50 
AnswerRe: File Upload using WebClient c# Pin
shamsallana19-Mar-06 22:23
shamsallana19-Mar-06 22:23 
Questionweb services and proxy Pin
DeathJester_18-Mar-06 10:20
DeathJester_18-Mar-06 10:20 

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.