Slow drawing forms


Author
Message
Ben Kim
Ben Kim
StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)StrataFrame User (207 reputation)
Group: Forum Members
Posts: 99, Visits: 253
Has anyone come up with a solution to this issue?  I have seen this on the simplist of forms (20-30 controls).  You can watch the forms draw.  Sometimes taking 4-5 seconds.  I know .NET needs to compile it the first time when run so I reran the form and it after the initial compile.  Same results.

I have tried adding Me.SuspendLayout() prior to enabling/disabling controls (buttons with graphics seem to flicker when you Disable/Enable them), then .ResumeLayout after my settings.  I have tried turning on DoubleBuffering which seemed to do nothing.

I do not have the fastest machine or best graphics card available.  I use other development environments that compile to Win32 code and do not exhibit this behavior.  Yes I know .NET is compiled/optimized at runtime, but once compiled I would expect it to perform at the same level as a native Win32 generate application.

Am I expecting too much from .NET?

Ben

Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
No, with only 20-30 controls on the form, it should initialize and render much faster than 4-5 seconds.  Most likely, something else is causing a problem.  The SecurityDialog in the RBS has something like 60 controls on it. 

If you need to analyze the problem, I would recommend ANTS from Red-Gate software.  You can download their trial, which runs for 14 days.  Profile your application, and it will tell you how much time each line of code took when it ran.  That might give you a clue as to what is chewing up 4+ seconds in your form's loading.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search