I have a draw button, when you click the button it calls a subroutine and it will draw on the screen.
When I load the data i run the same subroutine during OnStartup it will not draw. I have to press the draw button to trigger the method in order for it to draw.
The question is how do I force it to draw?
I even tried this
btnDraw_Click(new object(), new EventArgs());
Update();
and still it won't work.
private void btnDraw_Click(object sender, EventArgs e)
{
if (btnDraw.Text == "Draw")
{
//button parameters
btnDraw.Text = "Complete";
btnDraw.Font = boldFont;
btnDraw.ForeColor = Color.Black;
btnDraw.BackColor = Color.Gray;
DrawMyLines();
bShowMarkerLine = false;
RemoveDrawObject("VLine");
RemoveDrawObject("EndLine");
}
else if (btnDraw.Text == "Complete")
{
btnDraw.Text = "Draw";
btnDraw.Font = regularFont;
btnDraw.ForeColor = Color.Black;
btnDraw.BackColor = Color.Lavender;
bShowMarkerLine = true;//
}
btnDraw.Enabled = true;
bUpdate = true;
Update();
}
Comment