i drew a line which fit in the output form when it is in minimized state. but when the it is maximized line remain the same height but the window expand. i want that the line and window expand and shrink in same ratio.
i hope i made u understand the problem.
Where in your code are you drawing the line? If you want the line to persist through changes in teh client, you could draw it in an overridden Paint() method on the form. If you use thew ClientRectangle as ddanbe suggested it will always be drawn relative to your forms size.
this.SizeChanged +=new EventHandler(Form1_SizeChanged);
protected override void OnPaint(PaintEventArgs e)
Point lineStart = new Point(this.ClientRectangle.Left, this.ClientRectangle.Height / 2);
Point lineEnd = new Point(this.ClientRectangle.Left + this.ClientRectangle.Width, this.ClientRectangle.Height / 2);
e.Graphics.DrawLine(new Pen(Brushes.Black), lineStart, lineEnd);
private void Form1_SizeChanged(object sender, EventArgs e)
This draws a line across the middle of the form. Any time the form is resized this.Invalidate causes a full repaint. The reason i include this is that when a user drags to resize the form will sometimes only repaint the newly revealed portion. This ensures the whole form repaints :)