473,385 Members | 1,766 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,385 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 6953
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.