I am trying to use a button to expand the size of my form. However, for some reason, he will not allow me to do this. I would have thought it would be easy to do, but I get an error message:
"An object reference is required for a non-static field, method or property 'System.Windows.Forms.Control.Width.get'
The code I use causes an error
private void options_Click(object sender, EventArgs e)
{
FileSortForm.Height = 470;
}
FileSortForm is the name of my form. In addition, on the advice of another site, I added this code to the form loading code.
this.Size = new System.Drawing.Size(693, 603);
source
share