|
-
Feb 24th, 2002, 01:43 PM
#1
Thread Starter
New Member
-
Feb 27th, 2002, 05:28 PM
#2
Frenzied Member
well I havent looked at your zip, but you could just use a picbox as container, then add some more, then you have to enable the dragdrop and now you can change the line coordinates everytime you get a drop event.
the only problem would be that the line won't change while moving the object.
Sanity is a full time job
Puh das war harter Stoff!
-
Feb 28th, 2002, 04:59 AM
#3
Thread Starter
New Member
Do you have any source code for this.
Thank you
but how can i associate a line with one object or more, that is, if a line is connected to 2 objects, when i start the drag to another position, how can i know the line that i have to move, without recording the line name and coordinates in the object's variables.
You see, i have a database with router information, and one table with information about what router is connected to the other or others. i need a way to dynamically create a network diagram in the picture box and record this info.
How do i create a line object my self with other properties and methods? OCX?
Is the best solution, creating something like:
myRouterObject with collections to hold the lineObject.name and X,Y coordinates?
Thank you again for your attention.
-
Feb 28th, 2002, 07:28 AM
#4
Frenzied Member
well I would stick with the line that vb has...
And I would create a user Type like
Type tNode
x as long
y as long
connected_to() as long
end Type
then you would need to have one tNode for every node...
like
dim myPCs(0 to numberofpcs) as tNode
than you would need to fill the types. Fill in the coordinates and into the connected_to you fill in the numbers of the other nodes it is connected to. Than after moving it you just draw a line like this
[pseudecode]
for cnt = 0 to Ubound(myPCs(number_of_dropped_object).connected_to)
drawline myPCs(number_of_dropped_object).x, _
myPCs(number_of_dropped_object).y, _
myPCs( myPCs(number_of_dropped_object).connected_to(cnt)).x_
myPCs( myPCs(number_of_dropped_object).connected_to(cnt)).y)
next
well that should work... (you probably see in the code that I program games normally... I am sure other people could give you better code...)
Sanity is a full time job
Puh das war harter Stoff!
-
Feb 28th, 2002, 03:31 PM
#5
Thread Starter
New Member
Thank you.
Thank you for your attention, i will try to put it into work.
:-)
-
Feb 28th, 2002, 04:33 PM
#6
Frenzied Member
Good luck
hope you got my point...
Sanity is a full time job
Puh das war harter Stoff!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|