using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Equazioni_2
{
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
label3.Text = Form1.cont1.ToString();
}
private void bt_coeff_Click(object sender, EventArgs e)
{
Ok();
}
private void Ok()
{
try
{
Form1.coefficiente[Form1.cont1].Real = double.Parse(textBox2.Text);
textBox2.Text = "";
Form1.cont1--;
if (Form1.cont1 != -1)
{
label3.Text = Form1.cont1.ToString();
if (Form1.cont1 == 0)
{
label3.Text = "";
label1.Text = "Termine noto: ";
}
}
else
{
this.Close();
}
textBox2.Select();
}
catch
{
MessageBox.Show("Inserire un valore numerico","Attenzione");
}
}
private void textBox2_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyData)
{
case Keys.Enter:
{
Ok();
textBox2.Select();
}
break;
}
}
}
}