Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ControlNode painting (Read 1504 times)
jscott
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 13th, 2009
ControlNode painting
Mar 25th, 2009 at 6:41am
Print Post  
Hey,

I'm having a painting issue when embedding a .NET control within my diagram.

I have a ControlNode, set the Control property, and attach it to a ShapeNode in the diagram.
When moving the parent ShapeNode or scrolling/panning the view, the Control is receiving OnPaint events, but the parent ControlNode is not receiving a Draw (or if it is, it is ignoring it). This is creating artifacts during these operations. The .NET control is painting all over the view (which doesn't appear to get invalidated during a pan), or flickering during a move (the control is set to double buffer).

Is there something I've missed? I would not wish to implement my own versions of the .NET control types just to get rid of these artifacts...  Smiley

My test is using System.Windows.Forms.Button.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode painting
Reply #1 - Mar 25th, 2009 at 8:12am
Print Post  
Hi,

This happens because mouse messages in Windows have higher priority than repaint messages, and the button has its own WinForms window that can't get its turn to repaint itself. You could handle NodeModifying and call diagramView.Refresh() to force the view and all child hosted controls to repaint themselves, though that will slow down mouse input handling. Another option is to style a ShapeNode to look like a button and handle the NodeClicked event, instead of using real buttons.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jscott
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 13th, 2009
Re: ControlNode painting
Reply #2 - Mar 26th, 2009 at 12:25am
Print Post  
Yes, the ShapeNode approach will have to do.

Thanks,
James
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint