懂C#的高手请进来!!!

来源:百度知道 编辑:UC知道 时间:2024/06/30 11:00:34
重修作业一:
求一元二次方程的根:a*x*x+b*x+c=0
从键盘输入三个常系数a b c,求x值;

要求:
使用控件如下lable,button,textbox;数字输入到textbox中,点击button进行求解,将结果显示于最后一个textbox;
界面例图见附件。

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace 方程
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox5;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;