Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

Slow redraw of controls when scrolling

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
silver - 17 Jan 2007 07:48 GMT
Hi all!

I am running VS2005/,NET 2.0, and experience really slow performance on
the refresh rate of GUI when scrolling  my forms.

To debug, I just created a clean UserControl and added about 50 empty
textboxes to it, no databinding, and set the AutoScroll property to
true.

When scrolling, the screen is updated really slow, the textboxes are
drawn partially, and blurr. CPU usage is 95-100%.

Does anybode know why this happens?

Best regards
Anders
Philipp - 17 Jan 2007 21:23 GMT
hello silver,

I guess during scroll all controls are repainted, this may also result
in a slight flicker. I had this problem myself with some controls I
designed. Try to put the following line in the user control constructor
(myControl.Designer.vb or .cs)

Me.DoubleBuffered = True    (or this.DoubleBuffered = true; if you are
using c#)

and tell us if it solves the problem.

This setting forces all control drawing to take place in a second
buffer before it is sent to the screen.

Regards
Philipp Fabrizio

silver schrieb:

> Hi all!
>
[quoted text clipped - 12 lines]
> Best regards
> Anders
silver - 18 Jan 2007 09:46 GMT
Thanks for your reply!

> hello silver,
>
[quoted text clipped - 13 lines]
> Regards
> Philipp Fabrizio

I have made some progress on this. A *release* build with DoubleBuffer
= True creates very good performance for the scroll of a UserControl.

The original issue is that we have the uc on a TabControl -> TabPage
surface. If I simply add the uc to the TabPage (drag 'n 'drop from the
Toolbox) the scroll gets extremely slow again. Note that the scrollbars
are defined on the uc, and the scroll is handled by it, as before, but
still performance stinks.

It seems like the TabPage hierarchy does not involve the UserControl
Type, and thus does not have the DoubleBuffer property.

Any advice is appreciated on how to boost the TabControl/TabPage
controls.

Anders
Philipp - 21 Jan 2007 11:05 GMT
ok, now that changes the problem a little bit. the cause for the major
performace lag is the gradient background of the tab control combined
with the transparency of all controls inside it.

to maintain the gradient for all controls, the tab page background is
calculated and repainted in a clip region for each control individually
before the control renders itself.

the only way to solve the problem is to set the background color of the
usercontrol or the tab page to a simple color like "Control", even if
it doesn't look that nice.

regards
philipp fabrizio

silver schrieb:

> Thanks for your reply!
>
[quoted text clipped - 32 lines]
>
> Anders

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.