473,775 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 924
"Dom" <do********@gma il.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
TableLayoutPane l 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 SystemInformati on class in the .NET Framework,
e.g. SystemInformati on.CaptionHeigh t 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
2734
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 desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE
8
2061
by: Robert | last post by:
Hi, I can use "with" like this: function MyObject(message) { this.message = message; } function _MyObject_speak() {
5
1818
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. Let's say that I choose zzzz, I'd like for a particular control (or text box) in my form to become required. At other times, if xx or xxx is inputed it would not be required. Is this possible? Thanks, and as always, further explanatiions...
5
1874
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 any built in functions to adjust the form based on resolution? Is there a way to detect the clients resolution? 1 last one, when using an image, how do I get the image to stay proportionate when reduced? Thanks,
6
2680
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 instance, if the users screen size is 800x600, I want the resolution to change to 1260x780 when running my program and then change back to 800x600 when exiting my program. Thanks, Darian
39
7441
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 Settings\ZoneMap The below code runs on a timer running several times per second and after about 15-30 minutes or so, it runs out of handles and crashes IE. I found an article on msdn discussing how setting properties in this
8
2313
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 height but with another lower resolution, can I do it automaticly with a script, not downloading them, changing them with image program and uploading them again.. Thank you
5
6208
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 either resolution 800 X 600 or 1152 X 864 it takes up the entire explorer size. In screen resolution 800 X 600, if I insert a pictures of 24 X 24 pixel in the cells it takes up the entire cell size (ideally it should as the cell size is also 24 X...
6
5312
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. Please help me out to find the way to get the native resolution of the monitor that is connected -BMK
92
4776
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 have a form where you can add and delete multiple serial information. This works wonderful. But now for every serial information i add i need to be able to add and remove multiple parts to that serial. heres an example of what i mean serial...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9915
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.