private void button1_Click(object sender, EventArgs e)
{
int[,] tabINT = new int[3, 3];
tabINT[0, 0] = 1;
tabINT[0, 1] = 0;
tabINT[0, 2] = 0;
tabINT[1, 0] = 0;
tabINT[1, 1] = 1;
tabINT[1, 2] = 0;
tabINT[2, 0] = 0;
tabINT[2, 1] = 0;
tabINT[2, 2] = 1;
for(int i=0; i < tabINT.GetLength(0); i++)
{
for (int j = 0; j < tabINT.GetLength(1); i++)
{
if (j < 2) textBox1.AppendText(tabINT[i, j].ToString() + " ");
else textBox1.AppendText(tabINT[i,j].ToString() + Environment.NewLine);
}
}
}
private void F1()
{
MessageBox.Show("Funkcja 1");
}
private void F2(string nazwa)
{
MessageBox.Show("nazwa");
}
private double F3(int katStopnie)
{
double sinus=0;
return sinus;
sinus = Math.Sin(katStopnie * Math.PI / 180);
}
private double Pierwiastek(double X, double Z)
{
return Math.Sqrt(X)+Z;
}
private double Potega(double A, double B)
{
return Math.Pow(A, B);
}
private void button2_Click(object sender, EventArgs e)
{
//F1();
//F2("Funkcja 2");
//F2(textBox2.Text);
//double x = F3(180);
//MessageBox.Show(x.ToString("0,00"), "sinus");
MessageBox.Show(Pierwiastek(4,5).ToString());
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
int A, B;
double W;
A = Convert.ToInt32(textBox3.Text);
B = Convert.ToInt32(textBox4.Text);
if (B == 0) throw new DivideByZeroException();
W = Math.Pow(A, B);
MessageBox.Show(W.ToString());
}
private void button4_Click(object sender, EventArgs e)
{
try
{
double A, W;
int B;
textBox5.Text = " ";
A = Convert.ToDouble(textBox3.Text);
B = Convert.ToInt32(textBox4.Text);
W = A / B;
textBox5.Text = Convert.ToString(W);
}
catch (DivideByZeroException)
{
MessageBox.Show("dzielenie przez zero");
}
catch (FormatException E)
{
MessageBox.Show("blad fromatu dancyh", "Uwaga", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(E.Message);
errorProvider1.SetError(textBox4, "zła wartość");
}
catch (Exception E)
{
MessageBox.Show(E.Message);
}
}
private void button5_Click(object sender, EventArgs e)
{
progressBar1.Value=0;
progressBar1.Minimum = 0;
progressBar1.Maximum = 1000000;
for (int i = 0; i < 100000; i++)
{
progressBar1.Value += 10;
}
}
{
int[,] tabINT = new int[3, 3];
tabINT[0, 0] = 1;
tabINT[0, 1] = 0;
tabINT[0, 2] = 0;
tabINT[1, 0] = 0;
tabINT[1, 1] = 1;
tabINT[1, 2] = 0;
tabINT[2, 0] = 0;
tabINT[2, 1] = 0;
tabINT[2, 2] = 1;
for(int i=0; i < tabINT.GetLength(0); i++)
{
for (int j = 0; j < tabINT.GetLength(1); i++)
{
if (j < 2) textBox1.AppendText(tabINT[i, j].ToString() + " ");
else textBox1.AppendText(tabINT[i,j].ToString() + Environment.NewLine);
}
}
}
private void F1()
{
MessageBox.Show("Funkcja 1");
}
private void F2(string nazwa)
{
MessageBox.Show("nazwa");
}
private double F3(int katStopnie)
{
double sinus=0;
return sinus;
sinus = Math.Sin(katStopnie * Math.PI / 180);
}
private double Pierwiastek(double X, double Z)
{
return Math.Sqrt(X)+Z;
}
private double Potega(double A, double B)
{
return Math.Pow(A, B);
}
private void button2_Click(object sender, EventArgs e)
{
//F1();
//F2("Funkcja 2");
//F2(textBox2.Text);
//double x = F3(180);
//MessageBox.Show(x.ToString("0,00"), "sinus");
MessageBox.Show(Pierwiastek(4,5).ToString());
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
int A, B;
double W;
A = Convert.ToInt32(textBox3.Text);
B = Convert.ToInt32(textBox4.Text);
if (B == 0) throw new DivideByZeroException();
W = Math.Pow(A, B);
MessageBox.Show(W.ToString());
}
private void button4_Click(object sender, EventArgs e)
{
try
{
double A, W;
int B;
textBox5.Text = " ";
A = Convert.ToDouble(textBox3.Text);
B = Convert.ToInt32(textBox4.Text);
W = A / B;
textBox5.Text = Convert.ToString(W);
}
catch (DivideByZeroException)
{
MessageBox.Show("dzielenie przez zero");
}
catch (FormatException E)
{
MessageBox.Show("blad fromatu dancyh", "Uwaga", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(E.Message);
errorProvider1.SetError(textBox4, "zła wartość");
}
catch (Exception E)
{
MessageBox.Show(E.Message);
}
}
private void button5_Click(object sender, EventArgs e)
{
progressBar1.Value=0;
progressBar1.Minimum = 0;
progressBar1.Maximum = 1000000;
for (int i = 0; i < 100000; i++)
{
progressBar1.Value += 10;
}
}