Link = https://www.dropbox.com/s/yl63nl33xrc3a2m/Capture.JPG?dl=0
Need help creating program using window form application which, the sales people can key in the size of the window frame, and how many sashes do it have in a textbox. In a frame can have more than 1-10 sashes, And it will the draw and generate the whole design according to the frame size, and the sashes is properly organize and spaced, example like in the picture at the top link.
this is some of my code using windows form
[edit]Code block added - OriginalGriff[/edit]
What I have tried:
public partial class Form1 : Form
{
Graphics drawArea;
public Form1()
{
InitializeComponent();
drawArea = pictureBox1.CreateGraphics();
}
private void button1_Click(object sender, EventArgs e)
{
int width, height, panel;
width = Convert.ToInt32(txtWidth.Text);
height = Convert.ToInt32(txtHeight.Text);
panel = Convert.ToInt32(txtPanel.Text);
Pen frame = new Pen(Color.Black);
drawArea.DrawRectangle(frame, 30, 30, width, height);
Pen Sashes = new Pen(Color.Black, panel);
if (panel == 1)
{
RectangleF[] sashesrec =
{
new RectangleF( 70, 70, width - 760 ,height-80 )
};
drawArea.DrawRectangles(Sashes, sashesrec);
}
else if (panel==2)
{
RectangleF[] sashesrec =
{
new RectangleF( 70, 70, width - 760 ,height-80 ),
new RectangleF(410, 70, width - 760 ,height -80)
};
drawArea.DrawRectangles(Sashes, sashesrec);
}
else if(panel==3)
{
RectangleF[] sashesrec =
{
new RectangleF( 70, 70, width - 760 ,height-80 ),
new RectangleF(410, 70, width - 760 ,height -80),
new RectangleF(750, 70, width - 760 ,height -80)
};
drawArea.DrawRectangles(Sashes, sashesrec);
}
}