Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram border (Read 1608 times)
Bertrand
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Jan 24th, 2018
Diagram border
Jul 17th, 2018 at 2:53pm
Print Post  
Hi,

I want to know if it is possible to show the border of the diagram (the drawing part only).
I want something like when I press the ALT key (maybe it changes the focus and with this action we can see a border like in the bitmap that I add in attachment).

Best regards,
Bertrand
  

DiagBorder.png ( 20 KB | 103 Downloads )
DiagBorder.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Diagram border
Reply #1 - Jul 18th, 2018 at 8:35am
Print Post  
Hi,

One way's through DrawForeground event handler -

Code
Select All
bool drawBorder = true;
void diagram_DrawForeground(object sender, DiagramEventArgs e)
{
	if (drawBorder)
	{
		e.Graphics.DrawRectangle(null,
			new System.Windows.Media.Pen
			{
				Brush = Brushes.Black,
				DashStyle = DashStyles.Dot
			},
			diagram.Bounds);
	}
} 



and call diagram.InvalidateForeground() when you toggle the flag. Other options could be drawing the border as a diagram.LaneGrid with a single cell, or by showing the diagram inside WPF Border element.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Bertrand
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Jan 24th, 2018
Re: Diagram border
Reply #2 - Jul 25th, 2018 at 12:57pm
Print Post  
Thank you !
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint