473,221 Members | 1,931 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,221 software developers and data experts.

Forms inaccuratly calculate size

I have a fairly straight-forward form that loads preferences upon
running, and saves them upon exiting. Included in the preferences are
things like window size & location, working directory, etc. There
seems to be a problem with the way the size of the form is being
calculated. If you run/exit/run/exit a bunch of times, the form keeps
growing vertically. This is because it looks like the forms Menu is
not being included into the size calculation. For example, if you set
the size programatically to 640x480, when the form displays, it adds in
19 vertical pixels for the menu to make the size 640x499. Then the
prefs write out, then on next load, the size is 640x518...and so on.

Subtracting the height of the menu when writing out the preferences
seems like the obvious answer, but it seems kludge-y, as the user might
have large fonts or something that will make a hard-coded subtract 19 a
bad idea. As far as I can tell, there isn't an easy way to tell the
height of a Menu object.

Has anyone run into this, or have a good solution for dynamically
calculating the height of a menu?

Thanks,
Chris

Jul 21 '05 #1
4 1950
mdb
"Chris" <cm******@gmail.com> wrote in news:1117568313.596901.48250
@g14g2000cwa.googlegroups.com:
Has anyone run into this, or have a good solution for dynamically
calculating the height of a menu?


Not sure, but you might try writing/saving Form.ClientSize instead of
Form.Size. I would think that ClientSize wouldn't include the size of any
menus.

--
-mdb
Jul 21 '05 #2
mdb
"Chris" <cm******@gmail.com> wrote in news:1117568313.596901.48250
@g14g2000cwa.googlegroups.com:
Has anyone run into this, or have a good solution for dynamically
calculating the height of a menu?


Not sure, but you might try writing/saving Form.ClientSize instead of
Form.Size. I would think that ClientSize wouldn't include the size of any
menus.

--
-mdb
Jul 21 '05 #3
I tried clientsize too. Actually, I tried all of the obvious ones,
Size, ClientSize, DesktopBounds and all of them do the same thing, and
only vertically. Removing the menu from the window altogether stops
this from happening.

Jul 21 '05 #4
I tried clientsize too. Actually, I tried all of the obvious ones,
Size, ClientSize, DesktopBounds and all of them do the same thing, and
only vertically. Removing the menu from the window altogether stops
this from happening.

Jul 21 '05 #5

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

Similar topics

0
by: Chris | last post by:
I have a fairly straight-forward form that loads preferences upon running, and saves them upon exiting. Included in the preferences are things like window size & location, working directory, etc. ...
8
by: Luke | last post by:
I have read the artivle on how to make forms, here it is: http://www.cs.tut.fi/~jkorpela/forms/choices.html For radio group buttons i would do : var buttonGroup = document.forms.elements; for...
6
by: Otie | last post by:
I have a project with a main form and a second form with a grid on it. Neither form is an MDI, thus neither form is a child - they are two independent forms. The CALCULATE button on the main form...
6
by: Herrcho | last post by:
in K&R Chapter 6.3 it mentions two methods to calculate NKEYS. and points out the first one which is to terminate the list of initializers with a null pointer, then loop along keytab until the...
4
by: ivan | last post by:
Hi, How can we calculate the stack and heap size requried by a C program. Is there any specific formula used? Please suggest. regards, Ivan
3
by: Joshua Russell | last post by:
Hi, Both the methods below open up a windows form called MasterForm. However, one works better than the other. Method 1 opens the form correctly but I don't have any reference to the instance of...
7
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls...
7
by: carterweb | last post by:
This is how I do it now. 1. Determine the dimensions of the rectangle. 2. Set a my font size to a fixed maximum size. 3. Apply the font my string and measure the string using the graphics...
4
by: vijay.db | last post by:
Hi Group, It's really confusing to calculate the size of the DB2 UDB database in versions lesser than 8.2. In Version 8.2 if we run the query db2 "call get_dbsize_info(?,?,?,0)" it gives us...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.