Hi, Tracy -
I believe the problem you are experiencing is due to (1) the way the PFC's window resize service is designed/coded and (2) the way you are using it.
If you examine the code in the resize service object (pfc_n_cst_resize), you'll see that there are two key instance variables:
long il_parentprevwidth = -1
long il_parentprevheight = -1
Their initial values of -1 indicate that no actual value has been set. Once the resize service is in active use (i.e., the window is being resized). these var's are updated every time the window's Resize event fires, which is quite frequently as the user drags a window's border. The new/current window width & height are compared against the previous Resize event's width & height to determine the amount of change (the delta's) in each.
Now, if you examine the code in the Resize event of the PFC's "master" ancestor window, pfc_w_master, you'll find the following code at the beginning:
// Notify the resize service that the window size has changed.
If IsValid (inv_resize) and This.windowstate <> minimized! Then
inv_resize.Event pfc_Resize (sizetype, This.WorkSpaceWidth(), This.WorkSpaceHeight())
End If
Note that if the window is maximized, the resize service does not get notified of the change in the window's size. This is intentional. When you make the window open in a maximized state, the resize service never gets called. Once the window is restored to it's original/design size, then the resize service can get involved, the instance var's get set, and the window resize service does its magic.
I suggest there are two ways to resolve your issue:
- Don't open the window in a maximized state (this is the "if it hurts when you do that, DON'T do that" solution). You can use a tip that Chris suggests; Open the window invisible/hidden, then in the pfc_PostOpen event, set the window state to Maximized! and immediately make it visible.
- Use the of_SetOrigSize(width, height) function of the resize service object as soon as you turn on the service, presumably in the window's pfc_PreOpen event. This function sets values for the two critical instance var's and changes their initial/default "no value has been set" values.
I admit that I have not tried either alternative, as I've never opened a PFC-based window in a maximized state... but I believe either of these alternatives should resolve the unusual behavior you are experiencing.
Best regards, John