组合框问题 ???
comobox1 有两个公式{n! 1+2...+n }。combox2 有三个数(2,3,4。。。)
现在要求 把combox2中的任意一数用公式n!或1+2.。。+n算出来 结果显示在标签label1中!
private void button1_Click(object sender, EventArgs e) { switch (comboBox1.SelectedText) { case "n1+n2+n3": textBox1.Text = Case1(comboBox2.SelectedText); break; case "n1*n2*n3": textBox1.Text = Case2(comboBox2.SelectedText); break; } } private string Case1(string text) { int result = 0; //... return result.ToString(); } private string Case2(string text) { int result = 0; //... return result.ToString(); }