move control WITHIN a panel

  • Thread starter Thread starter Nancy
  • Start date Start date
N

Nancy

BlankI'm new to VB.NET and OOP and have been reading and surfing the web in
an attempt to learn and understand. At this point I'm spinning my wheels and
wasting time. I want to be able to move a control1 around on a panel1, which
I am using as a design surface on a form. I can't find examples of how to
MOVE an *entire control* WITHIN the same container (i.e. panel, form) at
runtime. How would this be done using drag and drop? Should I use
mousedown/move/up events instead? If yes, how? Once I get over this hurdle I
want to use a line control (I'll have to create it) to intelligently connect
2 controls. Then, when I move any of the connected controls I need the
connections to remain intact. Any ideas on how to do this?

Many, many thanks in advance.

Nancy
 
do you mean MDI (Multiple Document Interface)?
if so, check out the IsMdiContainer and MdiParent properties in the Form
class.

hope this helps

Dominique
 
I am using as a design surface on a form. I can't find examples of how to
MOVE an *entire control* WITHIN the same container (i.e. panel, form) at

See if this article will help you:

http://www.bobpowell.net/manipulate_graphics.htm

As for lines drawn between controls (I assume you want something similar to
what Visio does). One possible way would be to have a Shape class. Each
shape would have one or more "connect points". Then you could have a Line
class with properties that indicate the two shapes the line will connect.
In the painting routine, somehow determine which connect points on the
objects to use based on their relative positions and draw the line between
them.

Hope this gives you some ideas.
 
Thanks Dominique but I wasn't refering to MDI. I'm working with lines and
pictureboxes. If interested, see my response to Chris' suggestion. Nancy
 
Thanks for responding Chris.

As for the URL (article), it's helpful but so far I haven't been able to
successfully implement his C code in VB code while trying to figure out what
he's doing. I'm working on it.

Haven't gotten to the shapes work yet but thanks for the good idea!

Nancy
 
Back
Top