Chapter 14 Managing Windows Forms and Controls at Run Time 361
Changing the StartPosition property to CenterScreen directs Visual Basic to display the
form in the center of the Windows desktop when you run the program.
- Click the Start Debugging button to run the application.
Visual Basic loads the form and displays it in the middle of the screen, as shown here:
- Click the Close button on the form to stop the program.
The IDE returns.
- Set the StartPosition property to Manual.
The Manual property setting directs Visual Basic to position the form based on the
values in the Location property.
- Set the Location property to 100, 50.
The Location property specifies the position, in pixels, of the upper-left corner of
the form.
- Click the Start Debugging button to run the application.
Visual Basic loads the form and then displays it on the Windows desktop 100 pixels from
the left and 50 pixels from the top, as shown in the screen shot on the following page.