Utilize VB6's screen Resolution Guides

VB6 contains a slew of commands that make programmers' lives easier. Unfortunately, most programmers are unaware that some of these great commands even exist. Peter Aitken fills you in on two little-known commands that help you in placing and sizing forms.

Visual Basic 6 provides a monitor icon in the lower right corner of the development environment that shows the position and size of the current form on the screen. You can drag the miniature form icon to change its position, which changes the Top and Left properties accordingly. The virtual screen on this monitor icon has the same pixel resolution as your actual screen.

Many VB programmers aren't aware that you can access two handy tools by right-clicking the icon and selecting from the popup menu. If you select the Resolution Guides command, it will display dotted lines for lower resolutions. For example, my screen is 1280x1024 pixels and I get resolution guides for 1024x768, 800x600, and 640x480. These guides are useful when you want to size and position your forms to work well on the widest possible variety of video hardware.

The other useful command on this menu is Startup Position. By default this is Manual, which means the form displays initially at the position you drag it to during design. Your other choices are Center Screen, Center Owner, and Windows Default.

These commands are yet another example of how VB makes the programmer's life easier.

Advance your scripting skills to the next level with TechRepublic's free Visual Basic newsletter, delivered each Friday. Automatically sign up today!

Editor's Picks

Free Newsletters, In your Inbox