So I have this code where I want to call the set_background
void in the resize_Handler
void. How would I do that? I tried set_background(null, PaintEventArgs());
inside the resize_Handler
, but it says non-invocable member cannot be used like a method
.
My code:
private void set_background(Object sender, PaintEventArgs e) {
Graphics graphics = e.Graphics;
Rectangle gradient_rectangle = new Rectangle(0, 0, Width, Height);
Brush b = new LinearGradientBrush(gradient_rectangle, Color.FromArgb(255, 255, 255), Color.FromArgb(255, 102, 54), 0f);
graphics.FillRectangle(b, gradient_rectangle);
}
private void resize_Handler(object sender, System.EventArgs e) {
// where I want to call set_background()
}