1. Paweł Kasperek
  2. PowerBuilder
  3. Thursday, 23 March 2023 12:47 PM UTC

Hi,

 

I look for the similar solution of SuspendLayout() method in Windows Forms (link: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.suspendlayout?view=windowsdesktop-7.0) in PowerBuilder.  I have got a window with multiple custom DataWindow (not cross and grid). These windows need more time, to load and show. Maybe, is a simple solution to suspend and resume drawing windows or control layouts ?

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 23 March 2023 13:17 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Pawel -

What I've done in similar situations is to set the Visible property of the window to False in the painter, then at some point in the window's Open or in a window control's Constructor (or a ue_PostConstructor user event posted from the control's Constructor event), set the window's visible property to True after all setup/initialization has completed. Then the user doesn't see the window in partially-opened state. I also usually issue SetPoint(Hourglass!) to make the user aware there is activity being performed, even if they cannot (yet) see it.

You just have to be sure that at some point you always make the window visible. I also use this technique when the window has to perform one or more checks to see if it is permissible to open. If not, issue a message and close the window without the user ever having seen it.

HTH, John

Comment
  1. Andreas Mykonios
  2. Thursday, 23 March 2023 13:42 PM UTC
In addition to John's answer, you may also check setredraw function.

Andreas.
  1. Helpful 2
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.