[Gtk-sharp-list] Editable Combo Box

Daniel Morgan danielmorgan@verizon.net
Tue, 30 Nov 2004 07:50:01 -0500


You could always keep a StringCollection of your entries.  
Add/Modify/Delete from the StringCollection.  Get a string array from the
StringCollection, and reset the list of strings in the Combo.

Combo combo;
StringCollection myCol = new StringCollection();

combo = new Combo ();
combo.DisableActivate ();
combo.Entry.Changed += new EventHandler (OnComboEntryChanged);
combo.Entry.Editable = false;

String[] myArr = new String[] { "tall","medium","short" };
myCol.AddRange( myArr );

String[] myArr2 = new String[myCol.Count];
myCol.CopyTo( myArr2, 0 );

combo.PopdownStrings = myArr2;

myCol.Add ("another_iterm");

myArr2 = new String[myCol.Count];
myCol.CopyTo( myArr2, 0 );

combo.PopdownStrings = myArr2;

Also, you could create a new class that derives from the Combo that adds
your own functionality.

-----Original Message-----
From: gtk-sharp-list-admin@lists.ximian.com
[mailto:gtk-sharp-list-admin@lists.ximian.com] On Behalf Of a a
Sent: Tuesday, November 30, 2004 5:41 AM
To: gtk-sharp-list@lists.ximian.com
Subject: [Gtk-sharp-list] Editable Combo Box


Hi,
   I am trying to create a combo box in which I can add/modify/delete
entries at runtime. I am facing difficulty in implementing it with the
standard Combo class.
        Is their any round about way to acheive this? 
or am I missing something obvious?

Thanks in advance,
A.



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list