Jas*_*eol 2 c# checkbox combobox winforms
我想创建一个复选框,如果选中它,那么它应该显示下拉列表.如果未选中,则应隐藏下拉列表.这就是我的代码在Form.Designer.cs文件中的外观.
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Items.AddRange(new object[] {
"Database 1",
"Database 2",
"Database 3"});
this.comboBox2.Location = new System.Drawing.Point(165, 436);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(150, 21);
this.comboBox2.TabIndex = 13;
this.comboBox2.Text = "Database";
Run Code Online (Sandbox Code Playgroud)
和我在其他文件中的复选框代码是
if (checkBox1.CheckState == CheckState.Checked)
{
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
690 次 |
| 最近记录: |