Technical Resources at AEGIS

PowerBuilder Tips

OpenSheet as Layered does not fire Resize Event

Tip By: Mike Barlotta


When writing an MDI Application in PowerBuilder, the function OpenSheet is used to open MDI sheets. If we want the window to open up layered we would code the following:

OpenSheet(w_sheet, w_frame, 0, Layered!)

However when a window is opened in this way the resize event is not fired. This can be a real problem if your window needs to size controls dynamically as it opens because users are using different resolutions or controls are not sized correctly in the window painter.

The Solution:

Open the window as original using the following code:

OpenSheet(w_sheet, w_frame, 0, Original!)

In the window open event code the following so that the window is still layered, but resizes accordingly:

ArrangeSheets(Layer!)