public void CreateComboBox(string text = "") { ComboBox Mcombo = new ComboBox(); Mcombo.Top = MemComboBoxes[count - 1].Top; Mcombo.Left = MemComboBoxes[count - 1].Left; Mcombo.Font = MemComboBoxes[count - 1].Font; Mcombo.Size = MemComboBoxes[count - 1].Size; Mcombo.DropDownStyle = ComboBoxStyle.DropDownList; Mcombo.SelectedIndexChanged += comboBox5_SelectedIndexChanged; for (int i = 8; i < 500; i *= 2) { Mcombo.Items.Add(i); } if (text != "") { Mcombo.SelectedIndex = UserControl3.CombSetValue(Mcombo, text); } Mcombo.Name = count + "M"; //if(isF) Mcombo.Top += interval; MemComboBoxes.Add(Mcombo); Controls.Add(Mcombo); Mcombo.BringToFront(); //Controls.Add(Mcombo); isF = true; }
public void LoadData() { string query = $"SELECT model,speed,nCors,razProc,sGPU,GAccelModl FROM Cors WHERE idProc={idCor}"; OleDbCommand command = new OleDbCommand(query, Form5.myConnection); OleDbDataReader reader = command.ExecuteReader(); reader.Read(); label2.Text += " " + reader[0].ToString(); textBox12.Text = reader[0].ToString(); textBox11.Text = reader[1].ToString(); comboBox8.SelectedIndex = UserControl3.CombSetValue(comboBox8, reader[2].ToString()); comboBox9.SelectedIndex = UserControl3.CombSetValue(comboBox9, reader[3].ToString()); textBox16.Text = reader[4].ToString(); comboBox15.Text = reader[5].ToString(); reader.Close(); }