RoguePoet01
Programmer
Hi,
I'm trying to initialize a picture box to equal the height and width of the form, but I keep getting an error.
Here is the code:
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
pb1.Size.Width = this.Size.Width;
pb1.Size.Height = this.Size.Height;
}
Here is the error:
Cannot modify the return value of 'System.Windows.Forms.Control.Size' because it is not a variable
I'm stumped, because if height and width isn't a variable, what the heck is it?
I'm trying to initialize a picture box to equal the height and width of the form, but I keep getting an error.
Here is the code:
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
pb1.Size.Width = this.Size.Width;
pb1.Size.Height = this.Size.Height;
}
Here is the error:
Cannot modify the return value of 'System.Windows.Forms.Control.Size' because it is not a variable
I'm stumped, because if height and width isn't a variable, what the heck is it?