473,320 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Build error when changing max or min size of form

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
Jul 21 '05 #1
1 2788
Solution:
Me.MinimumSize = Me.Size
Me.MaximumSize = Me.Size

Not that it matters, but I guess I thought that I could change (or set)
Me.MinimumSize.Height since the Intellisense description of that property was:
Gets or sets the vertical component of this System.Drawing.Size.

"John Tighe" wrote:
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.

Well, if there were build errors then an .exe was not created, so if you
procede then you are really running the last .exe that was built with no
errors.
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
1
by: Jon Pope | last post by:
I'm maintaining an internal tool within my organization. Some of my users have resized their system font size by changing the DPI setting from 96DPI to 120DPI (by right-clicking the desktop and...
0
by: Evan Delodder | last post by:
I am trying to edit form elements (labels, text box's, etc) in Visual Studio.NET using VB.NET. Whenever I edit certain forms’ appearance whether it is through the code, or through the designer, I...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
4
by: Steve Amey | last post by:
Hi all I have a Form that is inherited from a main form. On the child form I am putting 2 panels directly on the form, not in any other controls. If I build the project, 1 of the panels decides...
1
by: John Tighe | last post by:
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...
4
by: Vish | last post by:
Hi all, I am having a build error in one of the overloaded functions in my class. The function takes either a string as a parameter or a type referenced in another dll as a parameter. My class...
2
by: Brett.Shearer.AUS | last post by:
I work on a reasonably large project (if yours is bigger, please tell me just how big) and am wondering how other people are partitioning their assemblies/dealing with slow build times? Our...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.