// *** Add New Box *** private void button2_Click(object sender, EventArgs e) { newBox box = new newBox(); if (newBox1.textBox1.Text == "0") { MessageBox.Show("Please Enter Length!"); } { draw = true; box.BringToFront(); box.Location = new System.Drawing.Point(panel1.AutoScrollPosition.X + boxXcoord, panel1.AutoScrollPosition.Y + boxYcoord); box.TabIndex = nextBox; panel1.Controls.Add(box); boxYcoord += newboxcoord; box.Name = nextBox.ToString(); nextBox++; length = box.textBox1.Text; angle = box.TextBox2.Text; lineClass.sideLengthA = double.Parse(length); lineClass.angleInDegs = double.Parse(angle); lineClass.angleInRads = (Math.PI*(lineClass.angleInDegs+90)/180); MessageBox.Show("Length = " + length.ToString()); MessageBox.Show("Angle = " + angle.ToString()); Xdestin = (Convert.ToInt32(sideA * Math.Sin(lineClass.angleInRads)) + Xorigin); Ydestin = (Convert.ToInt32(sideA * Math.Cos(lineClass.angleInRads)) + Yorigin); panel2.Refresh(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)