Based on an .ini file, a subsidiary form in a VB6 project is either created as maximized or normal.
We'd like to position its objects based on the form's height, during Form Load before it's visible. (The form becomes visible later in the code.)
But we've found the height of the form is not adjusted after setting the windowstate to maximum. The value is the full height only after making the Form visible.
Example:
The height is correct only if we have the following after setting the form's WindowState to max:Code:Me.Height = screen2h 'value read in If screen2Max Then Me.WindowState = vbMaximized Else Me.WindowState = vbNormal End If msgbox "Height is " & Me.Height
This makes sense, I guess bec the form doesn't "exist" before visibility.Code:Me.Visible = True Me.Visible = False 'turn off bec we don't want the user to see this form yet
Is there another way to find the maximized height without flashing the form before the user?




Reply With Quote
