アプリケーションを最初に開いたときにピクチャ ボックスの背景を描画するメソッドを作成しようとしています。これを行う方法はありますか?
私はこれを試しました
private void Form1_Load(object sender, EventArgs e)
{
DrawBackground();
}
public void DrawBackground()
{
Graphics SimWindow = pictureBoxSimDisplay.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Green);
SimWindow.FillRectangle(brush, 0, 211, 491,5);
}
しかし、それは機能していません。