C# 组合框C中的selectedValue崩溃控制框#
当我从组合框中指定所选值时,我的Winforms应用程序不会通过C# 组合框C中的selectedValue崩溃控制框#,c#,winforms,combobox,controlbox,C#,Winforms,Combobox,Controlbox,当我从组合框中指定所选值时,我的Winforms应用程序不会通过控制框关闭(最小化、最大化工作,但不会关闭!) 如果我注释掉以下代码,它似乎是有效的: private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'dataSet1.NewSelectCommand' table. You can move, or remov
控制框关闭(最小化、最大化工作,但不会关闭!)
如果我注释掉以下代码,它似乎是有效的:
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet1.NewSelectCommand' table. You can move, or remove it, as needed.
this.newSelectCommandTableAdapter.Fill(this.dataSet1.NewSelectCommand);
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string databaseName = string.Empty;
databaseName = comboBox1.SelectedItem.ToString();
}
添加了更多代码。。。请帮忙谢谢@Sameer,你来自哪里?
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string databaseName = string.Empty;
if(comboBox1.SelectedItem != null) databaseName = comboBox1.SelectedItem.ToString();
}