hy guys i have a problem with my event
public delegate void paintEventHandler(object sender, EventArgs e);
Graphics paper;
public static event PaintEventHandler After1s;
private void Mouth_shut(Graphics gr)
{
gr.FillEllipse(new SolidBrush(Color.Yellow), 50, 50, 50, 50);
}
private void Mouth_Open(Graphics gr)
{
gr.FillPie(new SolidBrush(Color.Yellow), 50, 50, 50, 50, -30, 270);
}
private void timer1_Tick(object sender, EventArgs e)// occurs every second
{
After1s += new PaintEventHandler(Form1_After1s);
// after every passed second going to Form1_Paint, INVOKE doesnt work
}
void Form1_After1s(object sender, PaintEventArgs e)
{
paper = e.Graphics;
Mouth_Open(paper);
Thread.Sleep(500);
Mouth_shut(paper);
}
I cant get my object to morph , nothing happens. I tried to invoke it but it get some errors, any advice would be apreciated.