private void button2_Click(object sender, EventArgs e) { int x1 = Convert.ToInt16(textBox1.Text); int y1 = Convert.ToInt16(textBox2.Text); int x2 = Convert.ToInt16(textBox3.Text); int y2 = Convert.ToInt16(textBox4.Text); if (radioButton1.Checked == true) { xoa = 1; } hv = new hvuong(s.toado2(x1, y1), s.toado2(x2, y2), textBox10.ForeColor); this.Close(); }
private void button2_Click(object sender, EventArgs e) { int x1 = Convert.ToInt16(textBox1.Text); int y1 = Convert.ToInt16(textBox2.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 == textBox10.ForeColor) { MessageBox.Show("Mau to da bi trung mau duong ve"); return; } hv = new hvuong(s.toado2(x1, y1), s.toado2(x2, y2), textBox10.ForeColor); this.Close(); }
public Formhv(hvuong k) { // groupBox1.Text = "Hinh vuong "+i.ToString(); InitializeComponent(); hv = new hvuong(k.d1, k.d2, 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.d3.X, k.d3.Y); textBox5.Text = d1.X.ToString(); textBox6.Text = d1.Y.ToString(); d1 = s.toado1(k.d4.X, k.d4.Y); textBox7.Text = d1.X.ToString(); textBox8.Text = d1.Y.ToString(); int canh = (int)(Math.Abs(k.d1.X - k.d2.X) / 5); textBox9.Text = canh.ToString(); textBox10.ForeColor = k.mau; }
public hvuong getpro() { hvuong item = new hvuong(d1, d2, mau); return(item); }