I have a Form with a Panel which just fits on which I use to draw graphics. How can this panel be made to resize when one resizes the Form.?
Printable View
I have a Form with a Panel which just fits on which I use to draw graphics. How can this panel be made to resize when one resizes the Form.?
You should make an effort to look through the methods and properties available for Panel. If your panel will always 'just fit' it is really simple - just set the Panel.Dock propery to Fill. If there are other things going in the Form then you could create the Form.SizeChanged event handler (or ClientSizeChanged) and adjust the size of your Panel accordingly in code. (SizeChanged is sometimes preferable to Resize since, for example, clicking the Maximize button fails to trigger the Resize event.)