Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Create a new Windows Forms project in Visual Studio.
  2. Add a new Form to the project and set its BorderStyle property to None.
  3. Add a Panel to the top of the Form and set its Dock property to Top.
  4. Add any desired controls to the Panel and set their Dock or Anchor properties as needed.
  5. Add an Event Handler for the Form's Resize event.
  6. In the Resize event handler, set the size and location of the Panel based on the Form's current size and the desired height of the Panel.
  7. Set the SizeGripStyle property of the Form to Show to allow the user to resize the Form.
  8. Test the Form to ensure that it can be resized and that the Panel remains docked to the top of the Form.