Remedy for Form Flicker


Author
Message
Brad Vick
Brad Vick
StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 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?
StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Yes, we have experienced it... and the only solution we have found was to places sets of controls on separate tabs on the page.  The DoubleBuffer property on the form didn't do anything for us, either, and there is no way to completely lock a form and prevent drawing or to force the form to only draw one time.  Anyone else have a suggestion?
Brad Vick
Brad Vick
StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)StrataFrame Beginner (35 reputation)
Group: Forum Members
Posts: 33, Visits: 88




We try not to use tabs, instead we are using the panel manager and breaking the controls down inside individual panels.



Any ideas?
Ross L Rooker, Sr.
Ross L Rooker, Sr.
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 3
Is the flicker issue resolved in the framework when using tabbed forms?
Ben Hayat
Ben Hayat
Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)Advanced StrataFrame User (582 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
What I want to happen is basically draw the form invisibly, then once all the forms are drawn show the entire form.


You may want to set the Opacity=0 or .25 first and then when all controls are drawn, you can set to 1 through a loop to give it a nice effect.

..ßen
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Good to see back on the forum, ben!
StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K 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 (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K 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.
Jc Martinez
Jc Martinez
StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)StrataFrame Beginner (24 reputation)
Group: Forum Members
Posts: 20, Visits: 59
Hi Guys,

Since I’m new to .Net and strataframe I tend to read as many post to see what issues people are having and how they are handled. This one caught my attention in its absurdity Crazy that like Ben points out should not exists and after searching for this issue it seems to be a grieving complaint Angry among .net developers.

In any case its resolution is a little above my head Hehe but besides the solutions before mentioned I found these 2 post that might help others.

Frozen forms for flickering-free updates
http://www.dotnet2themax.com/blogs/fbalena/PermaLink,guid,6336502b-57c5-430d-9d37-7f9be484f6b3.aspx

Practical Tips for Boosting the Performance of Windows Forms Apps
http://msdn.microsoft.com/msdnmag/issues/06/03/WindowsFormsPerformance/

Ross L Rooker, Sr.
Ross L Rooker, Sr.
StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)StrataFrame Beginner (2 reputation)
Group: Forum Members
Posts: 2, Visits: 3
Unfortunately it is not just when a form loads. After my form is loaded, clicking on any tab, then back repeatedly, shows the ghost image of the tab clicked from while drawing the control on the page tab clicked to. If it was just on the page load it wouldn't be as bad. My thought would be a lock to the windows 32 desktop on the activation of the page tab and then unlocking after the tab is rendered. Is there any example of the win32 api code required to handle this and what event it should be located in?
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