473,406 Members | 2,620 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,406 software developers and data experts.

A problem with resolution

Dom
Sometimes, I have a window nicely laid out, but when it is run on
another PC, the bottom of it is lopped off. I assume this is because
of the resolution. I'm in the habit of adding code in Form_Load, like
this:

this.height = Control.top + control.height + 50

.... where Control is what I know is the bottom control. I don't like
doing this, especially when I change the layout and find it doesn't
work anymore. What do others do?

Dom
Jun 27 '08 #1
1 908
"Dom" <do********@gmail.comwrote:
Sometimes, I have a window nicely laid out, but when it is run on
another PC, the bottom of it is lopped off. I assume this is because
of the resolution. I'm in the habit of adding code in Form_Load, like
this:
this.height = Control.top + control.height + 50
... where Control is what I know is the bottom control. I don't like
doing this, especially when I change the layout and find it doesn't
work anymore. What do others do?
I'll assume you're talking about Windows Forms and not the newer WPF
stuff.

I've rarely seen any problem like that in Windows Forms, because the
layout is pixel-based (unlike traditional Visual Basic, which often
relied on dots per inch and could vary wildly), but I think you might
see this if the other user has changed the settings in Appearance in
Display Properties. For example, they can choose larger fonts in window
title bars, which changes the height as well.

The best solution is probably to make your windows resizable, so that
the user can drag them to whatever size is convenient. Of course, you'll
also need to use docking and margins so that things like status bars
stay at the correct side of the window, and other things expand to fit.
You will find the size-managing containers like SplitPanel and
TableLayoutPanel useful for this.

The more tiresome alternative is to keep counting 50 pixels like you are
doing, but using the proper measurements. You can find some of these as
static properties of the SystemInformation class in the .NET Framework,
e.g. SystemInformation.CaptionHeight for the height of a window title
bar. It's a pain, though, and if you do that, you should also handle
system events so that your window doesn't go crazy if the user changes
the display properties while it is running.

Eq.
Jun 27 '08 #2

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

Similar topics

0
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the...
8
by: Robert | last post by:
Hi, I can use "with" like this: function MyObject(message) { this.message = message; } function _MyObject_speak() {
5
by: Don Sealer | last post by:
I've got a validation rule that says something like =xx or xxx or zzzz. Though I may not have described it well it does work fine and that is really not my question. Here's what I'd like to do....
5
by: Joe Bonavita | last post by:
My Web forms display differently on different machine with the same resolution. The pages are designed to fit in 800*600 res but on some machines with 800*600 the form appears too big. Are there...
6
by: Darian | last post by:
I am wondering how (if it is possible of course) I can change a users screen resolution to a certain size when running my application and then change it back when they exit my application. For...
39
by: tydbowl | last post by:
I have a problem where the below code chunk causes handle leaks on some machines. The leak APPEARS to be handles to the registry key: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet...
8
by: NurAzije | last post by:
Hi, I wonder is there a way or a function to take a high resolution image and change it to low resolution ?? I have a directory with a 200 pictures, and want to save them with the same width and...
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
6
by: | last post by:
Hi, I need to get the the display monitor native resolution.I have tried SystemInformation.PrimaryMonitorSize. it is giving the exisiting resolution of the display monitor that is connected....
92
by: bonneylake | last post by:
Hey Everyone, Well i was hoping someone could explain the best way i could go about this. i have a few ideas on how i could go about this but i am just not sure if it would work. Right now i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.