Results 1 to 6 of 6

Thread: NetworkDiagrams with VB6.0

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Portugal
    Posts
    4

    Question NetworkDiagrams with VB6.0

    Hi.

    I need to know the best way to make a picture box a container for diagrams with objects and lines connecting them. and when i move one object, the line as to reflect the change of position.



    i send an attach in zip for you to see what i whant to do in VB.
    Attached Files Attached Files
    Just Me

  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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!

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Portugal
    Posts
    4

    Smile 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.
    Just Me

  4. #4
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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!

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Portugal
    Posts
    4

    Smile Thank you.

    Thank you for your attention, i will try to put it into work.
    :-)
    Just Me

  6. #6
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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
  •  



Click Here to Expand Forum to Full Width