Answer the question
In order to leave comments, you need to log in
How to call a function with PaintEventArgument e?
Here is the code:
private void Form1_Load(object sender, EventArgs e)
{
Draw();//trying to call this function
}
private void Draw(PaintEventArgs e) //want to draw an image on the form
{
Bitmap bitmap = new Bitmap("mankala_wood_board.png ");
e.Graphics.DrawImage(bitmap, 100, 50);
}
There is an error : There is no argument corresponding to the required formal parameter "e" from "Form1.Draw(PaintEventArgs)". What argument should be given?
Answer the question
In order to leave comments, you need to log in
private void Form1_Load(object sender, EventArgs e)
{
Draw(e);//пытаюсь вызвать эту функцию
}
protected override void OnPaint(PaintEventArgs e)
{
Draw(e);
base.OnPaint(e);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question