Exemplo n.º 1
0
        private void customComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            var item = (sBuildingType)customComboBox1.SelectedItem;

            if (item != null)
            {
                customComboBox2.DataSource    = Data_BuildingType.GetDataByIndex(item.index);
                customComboBox2.DisplayMember = "Name";
                customComboBox2.ValueMember   = "index";
            }
        }
Exemplo n.º 2
0
        private void InitComboBoxes(int ind)
        {
            if (ind == 1)
            {
                bool IsEnable = false;

                roundEdit1._RichTextBox.Enabled = !IsEnable;
                roundEdit1.Enabled = !IsEnable;


                customComboBox1.SelectedIndex = -1;
                customComboBox2.SelectedIndex = -1;

                customComboBox1.Enabled = IsEnable;
                customComboBox2.Enabled = IsEnable;
                roundPanel1.Enabled     = IsEnable;
                roundPanel2.Enabled     = IsEnable;

                customComboBox1.DataSource = null;
                customComboBox2.DataSource = null;

                roundEdit1.Focus();
                radioButton1.Focus();

                richTextBox1.Clear();
            }
            if (ind == 2)
            {
                bool IsEnable = true;

                roundEdit1._RichTextBox.Enabled = !IsEnable;
                roundEdit1.Enabled           = !IsEnable;
                roundEdit1._RichTextBox.Text = "";

                customComboBox1.Enabled = IsEnable;
                customComboBox2.Enabled = IsEnable;
                roundPanel1.Enabled     = IsEnable;
                roundPanel2.Enabled     = IsEnable;



                customComboBox1.DataSource    = Data_BuildingType.GetData();
                customComboBox1.DisplayMember = "Name";
                customComboBox1.ValueMember   = "index";
                customComboBox1.SelectedIndex = 0;


                customComboBox2.DataSource = Data_BuildingType.GetDataByIndex(0);

                customComboBox1.Focus();
            }
        }