dvanniel
New member
Hi,
Just what i was looking for
But i have one question...how can i get the drawn item to stay on the form? After a minimize/restore the rectangle ive drawn disappears
This i what ive coded now:
public void button1_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
DrawTiles.Draw(g, 10.0F, 20.0F, new SolidBrush(Color.Black));
}
Where the Draw method is:
public static void Draw(Graphics g, float x, float y, SolidBrush brush)
{
g.FillRectangle (brush, x+1, y+1, 28.0F, 28.0F);
}
So when the user clicks on button1 then rectangle is drawn, but as i wrote before...the thing disappears after a min/rest.
Does anybody know how to handle this?
Just what i was looking for
But i have one question...how can i get the drawn item to stay on the form? After a minimize/restore the rectangle ive drawn disappears
This i what ive coded now:
public void button1_Click(object sender, EventArgs e)
{
Graphics g = this.CreateGraphics();
DrawTiles.Draw(g, 10.0F, 20.0F, new SolidBrush(Color.Black));
}
Where the Draw method is:
public static void Draw(Graphics g, float x, float y, SolidBrush brush)
{
g.FillRectangle (brush, x+1, y+1, 28.0F, 28.0F);
}
So when the user clicks on button1 then rectangle is drawn, but as i wrote before...the thing disappears after a min/rest.
Does anybody know how to handle this?