Hi,
In on of the lecture notes that was given to me by my prof, I was told that setting the ResizeRedraw value to true would allow whatever I drew on the form to be, well, resized. However, it does not seem to work. Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test1
{
public partial class Form1 : Form
{
private Rectangle m_Rect;
public Form1()
{
Point p = new Point(ClientRectangle.Width / 2 - 100 / 2,
ClientRectangle.Height / 2 - 100 / 2);
Size s = new Size(100, 100);
m_Rect = new Rectangle(p, s);
InitializeComponent();
ResizeRedraw = true;
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Brush b = new SolidBrush(Color.Red);
Pen pen = new Pen(new SolidBrush(Color.Black));
e.Graphics.DrawRectangle(pen, m_Rect);
e.Graphics.FillRectangle(b, m_Rect);
}
}
}