另外一个窗口弹出来的问题??
一个listBox控件 点击listBox中的选项(考试的科目比方说数学) 按一下确定会弹出另外一个页面 应怎样设计 请各位高手 --------------------编程问答-------------------- listBox1_SelectedIndexChanged事件--------------------编程问答-------------------- 在点击确定的时候根据listbox的选中状态,让他弹出窗体就行了。 --------------------编程问答-------------------- 利用listBox1_SelectedIndexChanged事件来实现,然后用switch case根据你选择的值(listBox1.selectValue)来弹出那个页面! --------------------编程问答-------------------- 利用listBox1_SelectedIndexChanged事件来实现,然后用switch case根据你选择的值(listBox1.selectValue)来弹出那个页面! --------------------编程问答--------------------
UP --------------------编程问答-------------------- 直接用menu空间就可以了 --------------------编程问答-------------------- 这种问题自己在百度上多查查资料,很简单的。
public Form2()--------------------编程问答--------------------
{
InitializeComponent();
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//非模态对话框
Form1 fm = new Form1();
fm.Show(this);
//模态对话框
Form1 fm = new Form1();
fm.ShowDialog(this);
}
--------------------编程问答--------------------
public Form2()
{
InitializeComponent();
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.listBox1.SelectedItems.Count != 0)
{
Form1 fm = new Form1();
fm.ShowDialog(this);
}
}
--------------------编程问答-------------------- public Form2()
private void btnSure_Click(object sender, EventArgs e)
{
if (this.listBox1.SelectedItems.Count > 0)
{
string s = this.listBox1.SelectedItem.ToString();
Form1 f1 = new Form1(s);
f1.Show();
}
else
{
MessageBox.Show("您尚未选中数据");
}
}
{
InitializeComponent();
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Form1 fm = new Form1();
fm.Show(this);
//模态对话框
Form1 fm = new Form1();
fm.ShowDialog(this);
}
补充:.NET技术 , C#