.Net form loading excessive window updating

Posted by tbergman on 31-Aug-2016 13:34

I have an ABL .net form that loads a couple of ABL user controls. The user controls take a bit of time to gather their data and when the form loads I see this happening and it's fairly distracting. I would prefer it if the form was not visible until everything is fully loaded.

This issue is likely exacerbated by running under Citrix where screen writes are often slower.

Is there a remedy for this? I'd like to not show the window until everything is fully loaded.

Thanks

All Replies

Posted by Richard.Kelters on 31-Aug-2016 14:30

We've implemented LockWindowUpdate in our customer application. For better performance and a snappier feel.

Posted by tbergman on 31-Aug-2016 16:16

Does your application use .Net GUI?
 
I’ve used LockWindowUpdate in our ABL gui before successfully but can’t seem to accomplish the same with .net forms.
 
Thanks
 

Posted by Richard.Kelters on 31-Aug-2016 16:40

Yes we use GUI for .NET.

We use a super procedure in our application with:

PROCEDURE LockWindowUpdate EXTERNAL "user32":

       DEFINE INPUT  PARAMETER hWndLock AS LONG.

       /* DEFINE RETURN PARAMETER bReturn  AS SHORT. */

END PROCEDURE.

Run this with input either 0 or <form>:Handle:ToInt32()

Richard

Posted by Roger Blanchard on 05-Oct-2016 12:25

Tom,

Did the LockWindowUpdate work for you?

Posted by tbergman on 05-Oct-2016 14:36

Hi Roger,
 
I’ve used LockWindowUpdate and/or another technique using SendMessage and WM_SETREDRAW for many years with generally good success in the Progress GUI world. I didn’t have much luck in the .Net world.
Although I’m pretty sure I was able to get to the appropriate HWND, and in very simple tests it seemed to be working, when it came to implementing it in the complex form I was having issues with, it didn’t work for me.
 
I was able to get a reasonably good user experience by putting off the slow running parts to after the form’s Shown event at which point I could properly show a progress bar.
 
I don’t know why LockWindowUpdate didn’t work but I ran out of time to investigate.
 
 
Tom
 

Posted by Roger Blanchard on 05-Oct-2016 14:53

Thanks Tom.

Posted by Steve Croff on 10-Oct-2016 10:05

Something else very easy... it doesn't improve performance, but it makes a program with UI lag feel faster: Set the form Opacity to zero in the visual designer, then later in the Shown event, set Opacity back to 100.

Posted by Frank Meulblok on 11-Oct-2016 04:00

Since we're talking about .NET forms, also look at SuspendLayout & ResumeLayout methods.

( msdn.microsoft.com/.../system.windows.forms.control.suspendlayout(v=vs.110).aspx )

Posted by Roger Blanchard on 11-Oct-2016 05:35

We use SuspendLayout & ResumeLayout quite extensively. However, a MS tablelayoutpanel does not have those methods. Using those methods on a form with a tablelayoutpanel seems to have no effect.

Thanks.

Posted by Roger Blanchard on 11-Oct-2016 05:36

This seems like a nice trick. We will give that a try.

Thanks,

This thread is closed