obliczanie delta
OKNO1
namespace WindowsApplication3
{
public partial class Form1 : Form
{
static public float a, b, c;
static public Form2 okno2;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
okno2 = new Form2();
okno2.Show();
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = Convert.ToString(b * b - 4 * a * c);
}
}
}
OKNO2
namespace WindowsApplication3
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form1.a = Convert.ToSingle(textBox1.Text);
Form1.b = Convert.ToSingle(textBox2.Text);
Form1.c = Convert.ToSingle(textBox3.Text);
Form1.okno2.Dispose();
}
}
}