[Gtk-sharp-list] Editable Combo Box

a a regn20032@yahoo.com
Wed, 1 Dec 2004 05:08:10 -0800 (PST)


     With your example I require a separate button for
Add,Modify and Delete and capture the change and
update the combo list.
     I need to acheive the operations without having
EXTRA BUTTONS as described below. Any other logic
WITHOUT buttons is also ok to me.

  By default the Combo Entry field has all the items
separated by a semicolon(say some escape character )
By add/modify/delete on Combo dynamically I meant
Add:
    On clicking the arrow field the combo box should
list the items and the entry field should become empty
so that the user can type a new item to add to the
list.
Modify:
    The user selects one of the items from the list
and the entry contains that item. He then alters the
item and is considered as a modify.
Delete:
    Same as modify, but he removes the entire text.
Empty fields are not allowed.
    
Thanks,
A.
--- Daniel Morgan <danielmorgan@verizon.net> wrote:

> 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
> 
> _______________________________________________
> Gtk-sharp-list maillist  - 
> Gtk-sharp-list@lists.ximian.com
>
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 



		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com