Hi,
I have read that whenever we access a value type data, we get a copy. y question is regarding the Size property of the FORM class. So what I realized is that we cannot write the following:
Dim f As New MyForm()
f.size.height = 15 'Doesn't Work
f.size.height = 25 'Doesn't work
And the reason why we cant write this is because when the compiler resolves f.size.height then, it first evaluates f.size which RETURNS a value type data (SIZE property is of structure type) and therefore actually returns a copy. Therefore we are actually setting the size of a copy of the form through the form which the compiler disallows.
But we are allowed to write Console.WriteLine(form1.Size.Height). This statement works fine....Does that mean the height that gets printed is that of a duplicate (but same sized form)?
Any help would be greatly appreciated.
Regards,
Sougata