wComboBox.cs
using System; using System.Drawing; using System.Windows.Forms; public class WComboBox : WCtrl { ComboBox cbox; public WComboBox() { ctrl = cbox = new ComboBox(); cbox.Show(); } public WComboBox( String[] items ) : this() { for( int i = 0; i < items.Length; i++ ) { cbox.Items.Add( items[i] ); } cbox.Show(); } public WComboBox( EventHandler handler ) : this() { if( handler != null ) { cbox.Click += handler; } } public void AddItem(String text) { cbox.Items.Add(text); } public int getSelectedIndex() { return cbox.SelectedIndex; } public String getSelectedText() { return cbox.Items[cbox.SelectedIndex].ToString(); } public void selectFirstItem() { if( cbox.Items.Count > 0 ) cbox.SelectedIndex = 0; } }
댓글 없음:
댓글 쓰기