123456789101112
System::Void panel1_Paint(Object^ sender, PaintEventArgs^ e) { formPaint(sender, e, 1234); } System::Void Form1_Load(Object^ sender, EventArgs^ e) { panel1->Paint += gcnew PaintEventHandler(this, &Form1::panel1_Paint); } System::Void formPaint(Object^ sender, PaintEventArgs^ e, int intValue) { // TODO do your painting here }