G
Guest
Changing the max or min size of a form can be in code, but if I do that then
it causes build errors in my application. The build error is: Expression is
a value and therefore cannot be the target of an assignment. If the program
is run in spite of the build errors then we see that the code actually works.
Is there a way to resolve the build error issue?
I am using VB.NET. Microsoft Developement Environment 2002 v7.0.9466. .NET
Framework 1.0 v1.0.3705.
The same thing also happens in Microsoft Developement Environment 2003
v7.1.3088. .NET Framework 1.1 v1.1.4322.
Below is the code that I am trying to use. I am trying to make a form that
cannot be resized by the user.
Me.MaximumSize.Height = Me.Size.Height
Me.MaximumSize.Width = Me.Size.Width
Me.MinimumSize.Height = Me.Size.Height
Me.MinimumSize.Width = Me.Size.Width
My current workaround is to set these values in the Design mode of the form,
but I would rather do it in code because the form is easier to maintain if
the size only has to be changed in one place--in case the developer needs to
change the size of the form or copy the form to make a new one that is just
like it.
Thank you.
-John
it causes build errors in my application. The build error is: Expression is
a value and therefore cannot be the target of an assignment. If the program
is run in spite of the build errors then we see that the code actually works.
Is there a way to resolve the build error issue?
I am using VB.NET. Microsoft Developement Environment 2002 v7.0.9466. .NET
Framework 1.0 v1.0.3705.
The same thing also happens in Microsoft Developement Environment 2003
v7.1.3088. .NET Framework 1.1 v1.1.4322.
Below is the code that I am trying to use. I am trying to make a form that
cannot be resized by the user.
Me.MaximumSize.Height = Me.Size.Height
Me.MaximumSize.Width = Me.Size.Width
Me.MinimumSize.Height = Me.Size.Height
Me.MinimumSize.Width = Me.Size.Width
My current workaround is to set these values in the Design mode of the form,
but I would rather do it in code because the form is easier to maintain if
the size only has to be changed in one place--in case the developer needs to
change the size of the form or copy the form to make a new one that is just
like it.
Thank you.
-John