public Formhbh(hbh k) { // groupBox1.Text = "Hinh chu nhat "+i.ToString(); InitializeComponent(); hbh = new hbh(k.d1, k.d2, k.d3, k.mau); Point d1 = s.toado1(k.d1.X, k.d1.Y); textBox1.Text = d1.X.ToString(); textBox2.Text = d1.Y.ToString(); d1 = s.toado1(k.d2.X, k.d2.Y); textBox3.Text = d1.X.ToString(); textBox4.Text = d1.Y.ToString(); d1 = s.toado1(k.d4.X, k.d4.Y); textBox5.Text = d1.X.ToString(); textBox6.Text = d1.Y.ToString(); d1 = s.toado1(k.d3.X, k.d3.Y); textBox7.Text = d1.X.ToString(); textBox8.Text = d1.Y.ToString(); int c1, c2; c1 = (int)(Math.Abs(k.d2.X - k.d1.X) / 5); c2 = (int)(Math.Abs(k.d3.Y - k.d2.Y) / 5); textBox9.Text = c1.ToString(); textBox10.Text = c2.ToString(); textBox11.ForeColor = k.mau; }
private void button2_Click(object sender, EventArgs e) { int x1 = Convert.ToInt16(textBox1.Text); int y1 = Convert.ToInt16(textBox2.Text); int x3 = Convert.ToInt16(textBox7.Text); int y3 = Convert.ToInt16(textBox8.Text); int x2 = Convert.ToInt16(textBox3.Text); int y2 = Convert.ToInt16(textBox4.Text); if (radioButton1.Checked == true) { xoa = 1; } hbh = new hbh(s.toado2(x1, y1), s.toado2(x2, y2), s.toado2(x3, y3), textBox11.ForeColor); this.Close(); }
private void button2_Click(object sender, EventArgs e) { int x1 = Convert.ToInt16(textBox1.Text); int y1 = Convert.ToInt16(textBox2.Text); int x3 = Convert.ToInt16(textBox7.Text); int y3 = Convert.ToInt16(textBox8.Text); int x2 = Convert.ToInt16(textBox3.Text); int y2 = Convert.ToInt16(textBox4.Text); if (radioButton1.Checked == true) { xoa = 1; chon = 0; } if (chon != 0 && mauto == textBox11.ForeColor) { MessageBox.Show("Mau to da bi trung mau duong ve"); return; } hbh = new hbh(s.toado2(x1, y1), s.toado2(x2, y2), s.toado2(x3, y3), textBox11.ForeColor); this.Close(); }
public hbh getpro() { hbh item = new hbh(d1, d2, d3, mau); return(item); }