PaintBox Paint event

  • Thread starter Thread starter user
  • Start date Start date
U

user

hello
I have:
public void MyFunction(PictureBox b, PaintEventArgs e)

how can i set from code this function as PaintBox Paint Event handler ?
I tried:
box.Paint=MyFunction() and similar but always received errors..

Thanx
Michal
 
PictureBox pb = new PictureBox()
pb.Paint += new EventHandler(MyMethod)

private void MyMethod(object sender, PaintEventArgs e

Graphics g = e.Graphics

// et


Bear in mind that this will not modify the image in the picture box, but merely paint stuff over the top of the picture box when refreshed

Hope that help

jax
 
Back
Top