Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Shape Node  Customise (Read 2584 times)
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Shape Node  Customise
Sep 23rd, 2009 at 11:04am
Print Post  
HI

  Whne i am creating Node it is default Rectangle
and Borders are black  and Rounded corner.

I  am creating Nodes Programatically i need  No border in the rectangle It is look like simple Label.

and When i select the Node the rectangle border should be should be selected like that

pls give some inputs
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape Node  Customise
Reply #1 - Sep 23rd, 2009 at 1:11pm
Print Post  
If you need to hide or show the border depending on the selection state, you could toggle ShapeNode.Pen between Color.Transparent and some color in response to SelectionChanged event.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Shape Node  Customise
Reply #2 - Sep 23rd, 2009 at 1:52pm
Print Post  
can u explain
little more
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape Node  Customise
Reply #3 - Sep 23rd, 2009 at 2:54pm
Print Post  
Set the following in Window_Loaded so that new nodes do not display a border:

Code
Select All
var transparent = new SolidColorBrush(Colors.Transparent);
diagram.ShapePen = new Pen(transparent, 1);
 



Handle SelectionChanged as shown below to toggle the border on and off:
Code
Select All
private void OnSelectionChanged(object sender, EventArgs e)
{
	var transparent = new SolidColorBrush(Colors.Transparent);
	foreach (DiagramNode node in diagram.Nodes)
		node.Pen = node.Selected ? new Pen() : new Pen(transparent, 1);
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint