Drawing a dotted line between controls

  • Thread starter Thread starter Carl Gilbert
  • Start date Start date
C

Carl Gilbert

Hi

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
 
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

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdrawing.asp

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top