Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set Tag for Shapes (Read 2622 times)
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Set Tag for Shapes
Aug 1st, 2011 at 6:34am
Print Post  
Hi
In my application all shapes are created on the basis of ShapeId's

Code
Select All
 const double size = 50;
 double x = 0;
 double y = 0;
 int shapesPerRow = 1;

  foreach (string shapeId in Shape.Shapes.Keys)
     {
		  var node = diagram.Factory.CreateShapeNode(x, y, 50, 50);
		    node.Shape = Shape.Shapes[shapeId];
		    x += size + 4;
		    if (x > (shapesPerRow - 1) * (size + 5))
		    {
			  y += size + 4;
			  x = 0;
		    }
		    node.Locked = true;
		}
  



How to set Tag for each shape node in above code, tag like "Rectangle","Decision","Process" for respective shapes?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Set Tag for Shapes
Reply #1 - Aug 1st, 2011 at 10:58am
Print Post  
I'm not entirely sure what you want to achieve. If you simply want to assign the shape identifier to the node's tag, you can do it like this:

Code
Select All
node.Tag = shapeId; 


Regards,
Meppy
  
Back to top
 
IP Logged
 
SL_developer
YaBB Newbies
*
Offline


coding rocks

Posts: 43
Joined: Jul 26th, 2011
Re: Set Tag for Shapes
Reply #2 - Aug 1st, 2011 at 11:15am
Print Post  
Hi
Thanks for reply,
i have added this line of code but still tag is not displaying

I refered this sample
https://mindfusion.eu/_samples/_sample_DragDrop3.zip

in this sample I have to display tag, please tell me how to do that?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Set Tag for Shapes
Reply #3 - Aug 1st, 2011 at 11:57am
Print Post  
If you need to display the shape id, set it to the node's Text property:

Code
Select All
node.Text = shapeId; 


The alignment of the text within the node can be specified through the TextAlignment, HorizontalTextBlockAlignment and VerticalTextBlockAlignment properties.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint