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

Scaling controls (C#)

LR
I'm having problem scaling controls on the form. I have a form where
I'm adding my user control at design time. If I run at 96 dpi it looks
fine, all the controls inside my user control are sized and placed
correctly. As soon as I change font size to 120 dpi, the control and
all of it child controls are not looking right at design time.
Here's what happen when I run application:

1) If AutoScale of the form is set to true (at design time) and I'm
adding my control on the form load event, the control looks fine.
However, if I'll add control after form is loaded it doesn't look
right, all the controls inside of it are jammed.
2) If AutoScale of the form is set to false (at design time) and I'm
adding my control on the form load or after form is loaded it looks
the same as at design time – child controls look smaller and text
doesn't feet on the control's real-estate.

I would expect the controls to stay the same at 120 dpi as they were
at 96 dpi if AutoScale is set to false.

Can somebody help me with determining system current dpi and/or
rescale all the controls on the form based on current dpi.

Regards,
-Leo
Nov 16 '05 #1
1 6956
I have the exact same problem. In fact, I forgot that I had my laptop set
for 120dpi and I could never get my app to look just right until I figured
out I had it set to 120dpi.

"LR" <lr*********@yahoo.com> wrote in message
news:c7**************************@posting.google.c om...
I'm having problem scaling controls on the form. I have a form where
I'm adding my user control at design time. If I run at 96 dpi it looks
fine, all the controls inside my user control are sized and placed
correctly. As soon as I change font size to 120 dpi, the control and
all of it child controls are not looking right at design time.
Here's what happen when I run application:

1) If AutoScale of the form is set to true (at design time) and I'm
adding my control on the form load event, the control looks fine.
However, if I'll add control after form is loaded it doesn't look
right, all the controls inside of it are jammed.
2) If AutoScale of the form is set to false (at design time) and I'm
adding my control on the form load or after form is loaded it looks
the same as at design time - child controls look smaller and text
doesn't feet on the control's real-estate.

I would expect the controls to stay the same at 120 dpi as they were
at 96 dpi if AutoScale is set to false.

Can somebody help me with determining system current dpi and/or
rescale all the controls on the form based on current dpi.

Regards,
-Leo

Nov 16 '05 #2

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

Similar topics

0
by: LR | last post by:
I'm having problem scaling controls on the form. I have a form where I'm adding my user control at design time. If I run at 96 dpi it looks fine, all the controls inside my user control are sized...
1
by: Dennis Carolus | last post by:
hi, does anybody know if theres a way to scale a control to another resolution? i've only found the method Control.Scale, but this method doesnt for example change a buttons text size, but obly...
1
by: DEWright_CA | last post by:
Hello Everyone! I am curious if anyone has done anything so automate the scaling of controls based on screen resolution. In my case I have a minimum screen res of 1024x768 for my page size,...
17
by: IanIpp | last post by:
We have a 3 month old quad processor/dual core server running SQL Server 2005 and already it is getting close to hitting the CPU wall. An 8 way CPU box is prohibitively expensive and out of the...
1
by: Ivan P | last post by:
Hello! How to prevent scaling (resizing to bigger) controls like Dialog and buttons on resource file when user run application in 120dpi. I want my dialog size remains same as in 92dpi. I tried...
1
by: =?Utf-8?B?RnJlZEM=?= | last post by:
When I add controls to a pocket PC form at design time, all the scaling works fine. I see in the initialize code the use of AutoScaleDeminsions and AutoScaleMode. However, when I add a control...
1
by: jojo11368 | last post by:
Hello Iam using visual studio 2005. I want to extend/scale a panel and the controls in the panel on a form. Currently i have a default size for the panel. The forms windowstate containing...
0
by: igalep132 | last post by:
Hey all, I was trying to resize control size to the form size. I'm changing my form size according to current Screen Size by using Screen.PrimaryScreen.WorkingArea; and then I'm making a...
2
by: sam | last post by:
can someone show how to change print font width & heigh scaling? I am writing a code for barcode printing on smaller label. I do not want change font size, because this may cause the bar code...
4
by: Rob | last post by:
If you allow the user to Maximize a form, is there a way to automatically enlarge each control on the form in the same proportion ?
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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,...

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.