Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to create a id name for the shapenode using visual basic (Read 3049 times)
Ivan Gamo
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Nov 10th, 2012
how to create a id name for the shapenode using visual basic
Nov 23rd, 2012 at 6:16am
Print Post  
i want to know if there's a way on how to define or create an id name for every shape node that will create in diagramview. thanks in advance!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to create a id name for the shapenode using visual basic
Reply #1 - Nov 23rd, 2012 at 7:41am
Print Post  
It depends on what kind of id you need. E.g. you could assign a Guid to each new node by setting node.Id = Guid.NewGuid(). If you need consecutive integer numbers as identifiers, you could keep and update an integer counter as value of diagram.Tag and increment it for each new node:

Code
Select All
If diagram.Tag Is Nothing Then diagram.Tag = 0
node.Id = Diagram.Tag
Diagram.Tag = CInt(Diagram.Tag) + 1 



Whatever method you use, you might want to keep it in a separate sub and call from event handlers such as NodeCreated, NodePasted, and also after you create items programmatically.

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


I Love MindFusion!

Posts: 30
Joined: Nov 10th, 2012
Re: how to create a id name for the shapenode using visual basic
Reply #2 - Nov 25th, 2012 at 11:10am
Print Post  
node.id didn't work in visual basic. could you please give more sample codes? thank you very much. im a beginner in visual basic.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to create a id name for the shapenode using visual basic
Reply #3 - Nov 26th, 2012 at 7:07am
Print Post  
The Id property was first added in version 5.3.5 of the control. If you have an older version, use Tag instead.

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


I Love MindFusion!

Posts: 30
Joined: Nov 10th, 2012
Re: how to create a id name for the shapenode using visual basic
Reply #4 - Dec 1st, 2012 at 1:16pm
Print Post  
thank you sir. the codes that you posted really helps me. Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint