469,926 Members | 2,248 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Drawing a dotted line between controls


I am looking to draw a dotted line between two controls at design time and
render this at run time in a similar fashion.

The most basic application of this would be a panel with two buttons on it.
I would then draw a dotted line between the two. This line would then have
to move when either of the two buttons move to update the connection between
the two.

At runtime the line would be drawn between the two controls and its
properties should be easily modifiable. The reason for this last part is
that I am running some code to update the size and the location of each
control when the panel re-sizes.

I would therefore need to be able to update the start and end point of the
line when the controls move (at design time) and when the controls are
repositioned at runtime.

Regards, Carl Gilbert
Nov 21 '05 #1
1 3032
Hi Carl
This should be a simple task using the GDI+ drawing namespace( 2D drawing)
, you can just get the location x,y location of your buttons with respect
to the form ( you can get that from the property either at runtime) then
simple draw your line.
You can read on


Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by news-server | last post: by
6 posts views Thread by Rene | last post: by
2 posts views Thread by Champika Nirosh | last post: by
8 posts views Thread by Benoit Martin | last post: by
9 posts views Thread by davetelling | last post: by
2 posts views Thread by Brian Kendig | last post: by
5 posts views Thread by Macias | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.