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

How to perform Form AutoScale in C#

29
I am working on a PC with 1280x1024 resolution.
Now, my problem is how could my program automatically adjust its forms and all of the controls if I am going to run my program to other PC/laptop with different resolution?

Currently, I set the AutoScaleMode property of the form to Dpi but it doesn't work

Any help will be highly appreciated.
Jun 16 '10 #1
7 7559
ThatThatGuy
449 Expert 256MB
@mylixes
Windows forms will automatically scale up the form , if its WindowState property is set to Maximized...

so you don't need to worry...
Jun 16 '10 #2
mylixes
29
@ThatThatGuy
Form WindowState property is not set to Maximized as it should not be. So, how could do that?
Jun 16 '10 #3
ThatThatGuy
449 Expert 256MB
@mylixes
so if you set it to Maximized then it will adjust to any screen resolution
Jun 16 '10 #4
mylixes
29
@ThatThatGuy
I can't set it to Maximized.
I mean, I should not set it to maximized. So how could I auto re-sized the form if the resolution is different without the need of maximizing the form.
Jun 17 '10 #5
GaryTexmo
1,501 Expert 1GB
Well, if you design your form by setting the anchors on your controls properly, they should resize/position themselves based on the size of the host form.

Would that work for you? It's the "Anchor" property on anything inheriting from Control.
Jun 17 '10 #6
mylixes
29
@GaryTexmo
I tried to use anchor already, but it doesn't work as I want it to be.
Jun 17 '10 #7
ThatThatGuy
449 Expert 256MB
@mylixes
I think there's no way you gonna learn the preferable way..

Use Screen.PrimaryScreen.Bounds.Width and Screen.PrimaryScreen.Bounds.Height to get the visible screen size ....
Jun 17 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Anil0920 | last post by:
I have a very serious problem which really needs to be solved. We had a huge number of projects in 2002 that we recently converted to VS.NET 2003. The conversion was smooth and all is working well....
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
1
by: Jon Pope | last post by:
I'm maintaining an internal tool within my organization. Some of my users have resized their system font size by changing the DPI setting from 96DPI to 120DPI (by right-clicking the desktop and...
8
by: Ganesh J. Acharya | last post by:
SHREE GANESHA how does this work??????????????????????????????????????????????????????? the documentation says that, if the font in the form container changes automatically the form adjust it...
3
by: Xwire | last post by:
Can anyone explain why when i set the .ClientSize of a form, and then check the .ClientSize when the resize event fires, it is slightly off, generally 20(varys) pixels in the height but not...
3
by: Charles Law | last post by:
I have just been playing with AutoScale and I am unhappy with the way it appears to work. I have a form created on a desktop m/c where the screen font is Normal (96 dpi). The form looks fine at...
2
by: Vish | last post by:
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....
1
by: Jesper | last post by:
Hi, When working with high display resolution it's sometimes preferable to increase the general font size using control panel-> display properties-> settings -> advanced -> general -> Display ->...
5
by: kevinmajor1 | last post by:
Hello, all. I'm currently trying to write a script that will perform form validation upon submission. I know that more validation should be performed on the server's side...this is just a test to...
2
by: =?Utf-8?B?Tmljaw==?= | last post by:
Hi, I'm running into a scaling issue. I'm having a simple form. I have some control in that form (2 group boxes, one dock to the left , the other set to fill, with some misc. controls in them)....
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.