Hi i have the piece of code below which is supposed to draw lines, it isn't complete but should at least draw lines between the points in _currentLinks
Code:
protected override void OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
drawNetwork(graphics, this.Width, this.Height);
}
private void drawNetwork(Graphics graphics, int width, int height)
{
if (this._currentNodes.Count > 0)
{
foreach (Node node in this._currentNodes)
{
}
}
if (this._currentLinks.Count > 0)
{
foreach (Link link in this._currentLinks)
{
Pen linkPen = new Pen(Color.Blue);
linkPen.Width = 5;
graphics.DrawLine(linkPen, link.start, link.end);
linkPen.Dispose();
}
}
}
The problem is it doesn't draw anything, i've debugged it as best i know how and it goes through each of the "link"s in "_currentLinks" and goes through the drawline part but nothing appears on screen. Is there something obvious that i have missed. If someone can help i'd be very grateful!
Many thanks
Andy
edit: i aren't using width and height yet, they're there for future use at the moment