Discussion Locked

VB6 forms

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

My VB6 forms when compiled and run behave abnormally; the sizes of the forms displayed are different from those at the design phase. I want to see exactly what I designed at the design phase at the runtime.
What am I doing wrong?

7 replies

by lo

In the Form Load event add settings for the form properties for:
HEIGHT - Height of the form (top to bottem)
WIDTH - Width of form (left to right)
TOP - Screen pos of Top Left corner
LEFT - Screen pos of left side of Screen

If these aren't set, positin and size are calculated and set by standard algorithms.

There is a way to make the window dynamic relative to the screen size. A given setting for the above will display a different size and position on a 640x480, 800x600, 1024x768, etc. resolution monitor. I thik you can get the current monitor settings at run-time but I don't know how/where.

by rsv

HI,
You try to set the forms size and the position in the form load event or form resize event, so that whenever the form is loaded or resized, the size and position of form will be maintained as you required.

In the form load or resize event, specify the left, top, width, height properties of the form. For example ,

me.top=0 'setting the form at top of screen
me.left=0 'setting the left of the screen
me.width=screen.width 'setting the width of the form as the width of the screen.me.height=screen.heigth 'setting the height of the form as the height of the screen.

Hope this helps you.
GOOD LUCH...:)

by donq

double click on the form in Design View to open it's Propertie's window. Set the "BorderStyle" property to "1 - Fixed Single", or "3 - Fixed Dialog".

What you design is what you get after that unless you enter some modifyer in Width, Left, Top,or Height.

This discussion is closed to new replies.