Web Development

General discussion


Difficulty with FORM sizing and SHOW command in VB6

By rovercom ·
Since switched from VB4 to VB6 I have difficulty with the FORM size and location. In design mode the form does not show up in its original size. I have always to drag the width and height to the correct positions. Next time when I open the form again it does not open to the correct properties, although the values in the property listing are correct.

At runtime the forms also open incorrectly, however I have been able to overcome that by using the MOVE command after the SHOW command. However, this does not work using the modal command SHOW 1. The form sizing remains incorrect because the FORM_LOAD procedure is halted untill the FORM_UNLOAD command is given.
What is the sollution for this? Do I need to load a reference file, and if so which one?

Your help would be greatly appreciated.

Many thanks in advance,


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Windowstate, startposition

by baileyg In reply to Difficulty with FORM sizi ...

Check that the Windowsate for the form is normal and the Startposition is manual.
I haven't got VB6 to hand but I think these are the correct properties.

Collapse -

Must set form size in code for MDI children

by DaveT In reply to Windowstate, startpositio ...

It is apparently a bug in VB6: sizeable MDI child forms do not restore their design-time sizes. This does not appear to affect fixed-border forms or non-MDI forms. Just call the form's .Move method in the form load event to set the desired size and position.

Collapse -

Still problems with FRAME sizing

by rovercom In reply to Windowstate, startpositio ...

Thanks baileyg for you reply and sorry for my late responds.

This isn't the problem, because all FRAMES have the Windowstate set to 0 (= Normal) and the Startposition also set to 0 (= Manual).

Some FRAMES are opening in the design mode in the correct size, where others stay in the size of a FRAME's runtime size.

I need to use a Modal window, however it does not respond to the MOVE command in the FORM_LOAD sub to have the sizing set correctly.

I tried to call the form using the FORMx.SHOW 1 command, however, when the FORMx opens it does not respond to the MOVE command. A second SHOW or SHOW 1 command results in an error (Form already open).

I tried to mirror the MSGBOX command, with a Text box for user intervention in a search application.

Do you have any other idea?

Thanks for your reponds in advance.

Collapse -

Initialize the form first

by jadrikop In reply to Still problems with FRAME ...

Private Sub Form_Initialize()
With Form
.Height = 10575
.Width = 15420
.Top = 0
.Left = 0
End With
End Sub

Related Discussions

Related Forums