示例#1
0
        /**
         * Method to create a radio button group with radio buttons.  We'll use the FlowLayout Panel to group the radio buttons
         **/
        private FlowLayoutPanel CreateRadioGroupUIElement(Element element, int viewID)
        {
            FlowLayoutPanel panel = new FlowLayoutPanel();

            // fetch element options for each radio button
            if (element.HasOptions == false)
            {
                element.FetchElementOptions();
            }

            // apply element options
            foreach (string option in element.ElementOptions)
            {
                RadioButton rb = new RadioButton();
                rb.Text = option.ToString();
                panel.Controls.Add(rb);
            }
            return panel;
        }
示例#2
0
        /**
         * Method to create a combo box element
         **/
        private ComboBox CreateComboBoxUIElement(Element element, int viewID)
        {
            ComboBox comboBox = new ComboBox();
            comboBox.Name = viewID.ToString();

            // fetch element options
            if (element.HasOptions == false)
            {
                element.FetchElementOptions();
            }

            foreach (string option in element.ElementOptions)
            {
                comboBox.Items.Add(option);
            }
            return comboBox;
        }