473,625 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control Location in Windows form and DPI settings on the monitor

Hi,

I am trying to move controls around in a form based on user selection on a
combo-box. So i hard coded the location and distances of where and how much
to move controls by in my program. Everything works fine on my machine. But
when i run my program on another machine which has a diferent DPI setting on
the monitor(mine was 120 and the other machine was 96) the control position
and the distances were bad. I am assuming that it because when i move a
control down by a given distance (100) to a certain location, the distance
evaluates to be a different location on the other computer with different DPI
setting. I know some people used to have similar problems in VB6 but i
thought microsoft fixed it in .NET. How do i make my form appear uniform on
both computers with different DPI settings? I would appreciate any help or
suggestions in this regard.

Thank You,
Vish
Feb 20 '06 #1
2 3132
Vish,

By default the DPI is 96. I guess the problem you having is because the form
has its AutoScale proeprty set to true. This makes the form to to adjust
based on the used font. The size of the font letters are affected by the DPI
settings so I guees that's why you get different result. Usually this is not
a problem, but mybe in your case it is.

Try to turn off this property.
--

Stoitcho Goutsev (100)

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:E2******** *************** ***********@mic rosoft.com...
Hi,

I am trying to move controls around in a form based on user selection on a
combo-box. So i hard coded the location and distances of where and how
much
to move controls by in my program. Everything works fine on my machine.
But
when i run my program on another machine which has a diferent DPI setting
on
the monitor(mine was 120 and the other machine was 96) the control
position
and the distances were bad. I am assuming that it because when i move a
control down by a given distance (100) to a certain location, the distance
evaluates to be a different location on the other computer with different
DPI
setting. I know some people used to have similar problems in VB6 but i
thought microsoft fixed it in .NET. How do i make my form appear uniform
on
both computers with different DPI settings? I would appreciate any help or
suggestions in this regard.

Thank You,
Vish

Feb 20 '06 #2
Hi Goutsev,

I appreciate your suggestions. That was not the problem in my case. I tried
setting the AutoScale property of the form to "None" but that did not fix the
problem. Any other ideas to try and fix the problem would be wonderful?

-Vish
"Stoitcho Goutsev (100)" wrote:
Vish,

By default the DPI is 96. I guess the problem you having is because the form
has its AutoScale proeprty set to true. This makes the form to to adjust
based on the used font. The size of the font letters are affected by the DPI
settings so I guees that's why you get different result. Usually this is not
a problem, but mybe in your case it is.

Try to turn off this property.
--

Stoitcho Goutsev (100)

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:E2******** *************** ***********@mic rosoft.com...
Hi,

I am trying to move controls around in a form based on user selection on a
combo-box. So i hard coded the location and distances of where and how
much
to move controls by in my program. Everything works fine on my machine.
But
when i run my program on another machine which has a diferent DPI setting
on
the monitor(mine was 120 and the other machine was 96) the control
position
and the distances were bad. I am assuming that it because when i move a
control down by a given distance (100) to a certain location, the distance
evaluates to be a different location on the other computer with different
DPI
setting. I know some people used to have similar problems in VB6 but i
thought microsoft fixed it in .NET. How do i make my form appear uniform
on
both computers with different DPI settings? I would appreciate any help or
suggestions in this regard.

Thank You,
Vish


Mar 6 '06 #3

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

Similar topics

4
2381
by: John | last post by:
I'd like to write a programme that runs on a PC with two monitors. The application would be used in a shop, with one monitor for shop assistant and the other for the customer. The two must show things independently, so the application can display certains things on one monitor (eg goods in the store) and certain other things on the other monitor (eg details of a certain product). Is this possible?
0
1314
by: dvestal | last post by:
I have a large form, with several hundred controls. When I open it in the designer, the designer resizes the form, but does not adjust the size of anchored controls in containers, thus corrupting them. With a great deal of effort, I've managed to remove every control that isn't needed to reproduce the problem. To reproduce the problem, do the following: 1) Create a project with the code below. Note that tabGeneral is 690 pixels high,...
1
1347
by: Nilam2477 | last post by:
I have wizard kind of Windows Application with Forms having Prev & Next buttons. Currently i have set the Location for all the Forms on Form_Load() method using this.Location = new Point(100, 100); Now my requirement is that when using "Extend my Windows desktop onto this monitor” setting in Display/Settings Properties, the form should stay in the user’s selected monitor. When i go to the Next form it defaults to the main monitor. I tried...
1
2488
by: euroluxantiques | last post by:
Hi All, Using VB.Net with SQL Server. I have a form that I create a number of Picture Boxes on dynamically, based on a stored procedure that retrieves a listing of images available for a particular product and populates the picture boxes using the paths found by the stored procedure. Anyway, that part works great. I have the Picture Boxes set a 231 px wide by 231 px high, and I want to resize these in a separate box when a user hovers...
0
8253
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
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
8635
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
8354
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
7182
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
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
4192
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.