Home
Files
Forms
Graphics
Printing


Search the Web

Forms Lesson 1 for Visual Basic.net


This lesson should not be very difficult. Make sure you have created a project and have the form open in the designer. The best way to access the user's screen size is through the My.Computer namespace.

There are many other features of My.Computer that will give you access to several settings of the user's system. These will be covered in future articles.

The coordinate system used for the screen and forms is that 0,0 refers to the left and top of the screen. The top value goes up as you move vertically down the screen from the top. The left value goes up as you move from left to right horizontally across the screen.

Double click on the form that you have showing and it will put you on the code page in the Form_Load event. Move your cursor outside of the routine and type the following code:



After you have done this move your cursor back to the Form_Load event or any routine you wish to call this sub from and type:

Me.ResizeFormtoScreen()

You may rename this routine to whatever feels right for you.



Visual Basic Forms Lesson 1 Image