Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Painting while sizing/moving (Read 3629 times)
mytech
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 15th, 2007
Painting while sizing/moving
Jun 15th, 2007 at 3:52pm
Print Post  
I'm using a ControlHost object where I have a TextEditor. While re-sizing it or moving it, re-paint seems to be very slow. It takes a long time for the control to catch up when moving it and while re-sizing it, it leaves traces of the handles in many "sizing moves" before they disappear. Any one who know why this is? I'm in the midst of learning the FlowChart.NET so maybe I have missed something.
All the best / Mikael
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Painting while sizing/moving
Reply #1 - Jun 15th, 2007 at 5:49pm
Print Post  
Windows sends WM_PAINT messages to controls only when there aren't any other messages in the message queue, so the hosted control is not repainted until you pause moving the mouse. If you need better performance, use Box objects to display data, and display ControlHosts only for data entry, e.g. when a box is double-clicked.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Painting while sizing/moving
Reply #2 - Jun 15th, 2007 at 5:55pm
Print Post  
I don't know if this will work, but you might try deriving from TextBox and calling its SetStyle method to enable double-buffering. SetStyle is a protected method, so you cannot call it directly on a TextBox instance.

Stoyan
  
Back to top
 
IP Logged
 
mytech
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 15th, 2007
Re: Painting while sizing/moving
Reply #3 - Jun 16th, 2007 at 10:58am
Print Post  
Thank's for the tip. I'll have a try at it.
All the best,
Mikael
  
Back to top
 
IP Logged
 
mytech
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 15th, 2007
Re: Painting while sizing/moving
Reply #4 - Jun 16th, 2007 at 11:23am
Print Post  
Hi Stoyo,

I found a quick way to solve the problem.
I just use the ControlHostModifying-event, I take the control the ControlHost has and I make a Refresh on it. Now it looks nice when re-sizing it.
This could be a nice feature to have built in into the ControlHost component, to be able to select an option for having the hosted control refreshed synchronized with the ControlHostModifying-event.
All the best,
Mikael
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Painting while sizing/moving
Reply #5 - Jun 18th, 2007 at 6:05am
Print Post  
Hi Mikael,

Ok, that's a nice solution Smiley We'll implement it as a standard feature in the 5.0.1 release.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint