public static void PopulateComboboxWithTests(ComboBox comboBox) { foreach (var func in Funcs) { comboBox.Add(func.Key); } }
/// <summary> /// Adds multiple entries to Combobox at once. /// Accepts an iterable collection. /// Results in one call instead of calling add-method multiple times with one entry each time. /// </summary> /// <param name="comboBox">comboBox object</param> /// <param name="items">iterable string object</param> public static void AddRange(this ComboBox comboBox, IEnumerable <string> items) { foreach (var title in items) { comboBox.Add(title); } }
protected override void InitializeComponent() { Margins = true; Child = hPanel; hPanel.Children.Add(groupBox, true); groupBox.Child = vPanel; spinBox.ValueChanged += (sender, args) => { int value = spinBox.Value; slider.Value = value; progressBar.Value = value; }; slider.ValueChanged += (sender, args) => { int value = slider.Value; spinBox.Value = value; progressBar.Value = value; }; vPanel.Children.Add(spinBox); vPanel.Children.Add(slider); vPanel.Children.Add(progressBar); vPanel.Children.Add(iProgressBar); hPanel.Children.Add(groupBox2, true); groupBox2.Child = vPanel2; comboBox.Add("Combobox Item 1", "Combobox Item 2", "Combobox Item 3"); editableComboBox.Add("Editable Item 1", "Editable Item 2", "Editable Item 3"); radioButtonList.Add("Radio Button 1", "Radio Button 2", "Radio Button 3"); vPanel2.Children.Add(comboBox); vPanel2.Children.Add(editableComboBox); vPanel2.Children.Add(radioButtonList); }
protected override void InitializeComponent() { IsMargined = true; hContainer.Children.Add(groupContainer, true); groupContainer.Child = vContainer; spinBox.ValueChanged += (sender, e) => { int value = spinBox.Value; slider.Value = value; progressBar.Value = value; }; slider.ValueChanged += (sender, e) => { int value = slider.Value; spinBox.Value = value; progressBar.Value = value; }; vContainer.Children.Add(spinBox); vContainer.Children.Add(slider); vContainer.Children.Add(progressBar); vContainer.Children.Add(iProgressBar); hContainer.Children.Add(groupContainer2, true); groupContainer2.Child = vContainer2; comboBox.Add("Combobox Item 1", "Combobox Item 2", "Combobox Item 3"); editableComboBox.Add("Editable Item 1", "Editable Item 2", "Editable Item 3"); radioButtonList.Add("Radio Button 1", "Radio Button 2", "Radio Button 3"); vContainer2.Children.Add(comboBox); vContainer2.Children.Add(editableComboBox); vContainer2.Children.Add(radioButtonList); }
private void InitializeComponent() { _hBox = new HorizontalBox() { AllowPadding = true }; this.Child = _hBox; _group = new Group("Numbers") { AllowMargins = true }; _hBox.Children.Add(_group, true); _vBox = new VerticalBox() { AllowPadding = true }; _group.Child = _vBox; _spinBox = new SpinBox(0, 100); _slider = new Slider(0, 100); _progressBar = new ProgressBar(); _spinBox.ValueChanged += (sender, args) => { var value = _spinBox.Value; _slider.Value = value; _progressBar.Value = value; }; _slider.ValueChanged += (sender, args) => { var value = _slider.Value; _spinBox.Value = value; _progressBar.Value = value; }; _vBox.Children.Add(_spinBox); _vBox.Children.Add(_slider); _vBox.Children.Add(_progressBar); _ip = new ProgressBar(); _ip.Value = -1; _vBox.Children.Add(_ip); _group = new Group("Lists") { AllowMargins = true }; _hBox.Children.Add(_group, true); _vBox = new VerticalBox() { AllowPadding = true }; _group.Child = _vBox; _comboBox = new ComboBox(); _comboBox.Add("Combobox Item 1", "Combobox Item 2", "Combobox Item 3"); _vBox.Children.Add(_comboBox); _editableComboBox = new EditableComboBox(); _editableComboBox.Add("Editable Item 1", "Editable Item 2", "Editable Item 3"); _vBox.Children.Add(_editableComboBox); _radioButtons = new RadioButtonList(); _radioButtons.Add("Radio Button 1", "Radio Button 2", "Radio Button 3"); _vBox.Children.Add(_radioButtons); }
public static void Add <T>(this ComboBox comboBox, T item) where T : Enum { comboBox.Add(Enum.GetName(typeof(T), item)); }