Skip to content

Draw arrows between buttons

Priyadarshini Gajbe

Asked Apr 15, 2007, 11:59 PM EDT1 answer
Share
LinkedInX
Hi,

I got Form F1 which consists of one label and on click of this label it creates a  new form F2 with three dynamically created buttons(the number of button to be created is passed from the label ) out of which i want to join two buttons with the third one by arrow, i.e there should be one arrow coming from button1 to button 3 and button2 to button3.

I tried with  ControlPaint.Drawreversible but the problem is that I m getting a line (not an arrow) on the parent form F1. Does any one knows how to do it?


Thanks in advanced,
Priya

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0
    I got Form F1 which consists of one label and on click of this label it creates a  new form F2 with three dynamically created buttons(the number of button to be created is passed from the label ) out of which i want to join two buttons with the third one by arrow, i.e there should be one arrow coming from button1 to button 3 and button2 to button3.

    I tried with  ControlPaint.Drawreversible but the problem is that I m getting a line (not an arrow) on the parent form F1. Does any one knows how to do it?


    It's not clear from your question what you are trying to do here.  Are all buttons on the second form (F2)?  If so, form1 has nothing to do with it.  If you want to draw arrows directly on the form (f2), you need to do so in the OnPaint Routine of the form.  You can use 
    e.Graphics.DrawLine  from the Paint Event Handler

    Code
    Pen pen = new Pen(Color.FromArgb(255, 0, 0, 255), 8);
    pen.StartCap = LineCap.ArrowAnchor;
    pen.EndCap = LineCap.RoundAnchor;
    e.Graphics.DrawLine(pen, 20, 175, 300, 175);
    0