Remedy for Form Flicker


Author
Message
Brad Vick
Brad Vick
StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)StrataFrame Novice (51 reputation)
Group: Forum Members
Posts: 33, Visits: 88




I have spent quit a bit of time searching for a remedy for our form flickering issue. On some of our busy forms (80-100 controls) when the form is drawing you can see the individual controls being drawn, which causes the form to flicker. What I want to happen is basically draw the form invisibly, then once all the forms are drawn show the entire form. I have attempted the doublebuffer solution but it has not helped the situation.



Has anyone else experienced this 'flicker'? If so how did you remedy it?
Replies
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
With the way that .NET uses controls that are individually windowed (each control is considered to be its own window wth its own hWnd), the drawing issues at form startup are hard to avoid.  There are some workarounds, but nothing that is simple:

1)  Show the form somewhere off screen (like (10000, 10000) and once the SetVisibleCore has existed (or once the Shown event fires), the move its location back to the screen

2)  For panels, show the panel off screen, once it's done rendering, use the Control.DrawToBitmap() method to take a snapshot of the panel, show a picture box in place of the panel with the picture, relocate the panel to slide it underneath the picture, and lastly, hide the picture.

There are other ways, but thinks like WM_SETREDRAW and LockWindow only work for one window handle at a time, and only affect the form, not all controls on the form.

The second option is what we ended up having to do for PracticeStudio.NET because the way our interface works, it doesn't have forms, just pages that open up as tabs.

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
You'd think for a $1 billion project like .NET 2.0 with 700 programmers, they'd come up with a way to prevent the flicker when forms load... oh well.
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