I’m creating a program in VB.NET (Microsoft’s Visual Basic 2010).
I want to know if I can put all my content in the center of the screen. At the moment it’s at the far top-left of the screen.
When the window size varies I want it to stay in the middle for all shapes and sizes. A similar example using HTML and CSS to achieve the above:
<div style="margin: 0 auto; width: 500px;"></div>
You should be able to do it using the
Form‘sResizeevent but personally I’d use theTableLayoutPanelcontrol (documentation here).Here are the steps:
PanelTableLayoutPanelPanelinto the center.Form.