472,114 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,114 software developers and data experts.

move control WITHIN a panel

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
Nov 20 '05 #1
4 5496
do you mean MDI (Multiple Document Interface)?
if so, check out the IsMdiContainer and MdiParent properties in the Form
class.

hope this helps

Dominique

"Nancy" <np***@systek.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #2
On Tue, 20 Jan 2004 17:57:50 -0500, Nancy wrote:
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.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #3
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
"Dominique Vandensteen" <domi.vds_insert@tralala_tenforce.com> wrote in
message news:Oy**************@TK2MSFTNGP12.phx.gbl...
do you mean MDI (Multiple Document Interface)?
if so, check out the IsMdiContainer and MdiParent properties in the Form
class.

hope this helps

Dominique

"Nancy" <np***@systek.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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


Nov 20 '05 #4
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
"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:1b****************************@40tude.net...
On Tue, 20 Jan 2004 17:57:50 -0500, Nancy wrote:
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.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Charles Zhang | last post: by
4 posts views Thread by =?Utf-8?B?UmljaEI=?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.