473,769 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scaling problem - font size

Hi,

I have my windows-display-font-size set to "Large fonts" and I've created a
new project with two forms. Both of them are 600 width and 400 height. One
have autoscale=true and the other is false. When I run the project, the two
forms shows the same size.

Now I open the project (in vs.net) on a computer with
windows-display-font-size set to "Small fonts" and my project is screwed up.
Now the width is 501 and the height is 351????????!!!! ! When I run the
project, the form with autoscale=true is smaller, which I can understand.

My question is .... why isn't my form size 600x400 when I open it on a
computer with "Small fonts"? ... and how can I make it the same size?

Lets say two develloper worked on the same project. One use "Large fonts"
and the other "Small fonts". How can I make vs.net show the forms at the
same size on both devellopers vs.net??

STRANGE! :o)

Thanks in advance!

M O J O
Jul 21 '05 #1
9 2465
Hi MOJO,

Based on your discription, I'm still not quite sure about the problem.
Could you tell me which window's size changed to 501*351? The one with
AutoScale set to true or false?

If it is the true one, it's because the size of the window is actually
changing. I didn't reproduced it on my machine when I set AutoScale to
false.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Kevin,

I'm sorry for beeing unclear.

Here's my question again....

I have a desktop computer with "Large fonts" and a laptop with "Small
fonts".

If I create a new project on my desktop and set the form size to 600x400
then when I open the same form (in vs.net form designer) on my laptop, it's
501x351 regardless of AutoScale is set to true or false.

In my search for a solution, I've stumbled over, that it must have somethig
to do with the AutoScaleBaseSi ze. I just can't figure out what to do.

I want to be able to open the form on my desktop and my laptop and keep the
size to 600x400, regardless of font sizes.

Hope you understand. :o)

Thanks!!!!

M O J O
"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> skrev i en meddelelse
news:GY******** ******@cpmsftng xa10.phx.gbl...
Hi MOJO,

Based on your discription, I'm still not quite sure about the problem.
Could you tell me which window's size changed to 501*351? The one with
AutoScale set to true or false?

If it is the true one, it's because the size of the window is actually
changing. I didn't reproduced it on my machine when I set AutoScale to
false.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
MOJO,

There may be a difference in the borders arround your forms. Try out
the following code to see if this helps you with your problem.

private void Form1_Load(obje ct sender, System.EventArg s e)
{
Width = 640 - (Width - ClientSize.Widt h);
Height = 400 - (Height - ClientSize.Heig ht);
}

"M O J O" <mojo@_no_spam_ delete_this_new websolutions.dk > wrote in message news:<uf******* *******@TK2MSFT NGP09.phx.gbl>. ..
Hi,

I have my windows-display-font-size set to "Large fonts" and I've created a
new project with two forms. Both of them are 600 width and 400 height. One
have autoscale=true and the other is false. When I run the project, the two
forms shows the same size.

Now I open the project (in vs.net) on a computer with
windows-display-font-size set to "Small fonts" and my project is screwed up.
Now the width is 501 and the height is 351????????!!!! ! When I run the
project, the form with autoscale=true is smaller, which I can understand.

My question is .... why isn't my form size 600x400 when I open it on a
computer with "Small fonts"? ... and how can I make it the same size?

Lets say two develloper worked on the same project. One use "Large fonts"
and the other "Small fonts". How can I make vs.net show the forms at the
same size on both devellopers vs.net??

STRANGE! :o)

Thanks in advance!

M O J O

Jul 21 '05 #4
I have had this same problem, and have found that the following workaround is
reasonably successful:

In every constructor of every form, as the first statement after the call to
InitializeCompo nent () add:

SizeF sf = Form.GetAutoSca leSize (this.Font);
this.AutoScaleB aseSize = sf.ToSize ();

I created a class with a static method so I can make it in one line, since
it is used a lot:

this.AutoScaleB aseSize = autoScaleHelpCl ass.GetBaseSize (this.Font);
After adding this, my app works pretty well among large and small font
systems, at multiple resolutions. Not perfect, but pretty good.

Hope this helps.
John
"M O J O" wrote:
Hi,

I have my windows-display-font-size set to "Large fonts" and I've created a
new project with two forms. Both of them are 600 width and 400 height. One
have autoscale=true and the other is false. When I run the project, the two
forms shows the same size.

Now I open the project (in vs.net) on a computer with
windows-display-font-size set to "Small fonts" and my project is screwed up.
Now the width is 501 and the height is 351????????!!!! ! When I run the
project, the form with autoscale=true is smaller, which I can understand.

My question is .... why isn't my form size 600x400 when I open it on a
computer with "Small fonts"? ... and how can I make it the same size?

Lets say two develloper worked on the same project. One use "Large fonts"
and the other "Small fonts". How can I make vs.net show the forms at the
same size on both devellopers vs.net??

STRANGE! :o)

Thanks in advance!

M O J O

Jul 21 '05 #5
Hi MOJO,

I agree with John, that we should also set AutoScaleBaseSi ze according to
the form font to resolve this issue. According to John's suggestion, we
have to add the following lines of code when form loads to make the form
fit.

SizeF sf = Form.GetAutoSca leSize (this.Font);
this.AutoScaleB aseSize = sf.ToSize ();
this.AutoScale = true;

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6
Hi John,

Thank you for answering my post!!!!

Unfortunately I cannot see any difference in doing what you suggested.

Please se my answer to Kevin.

Thanks anyway!!!!!

M O J O

"JohnReb" <Jo*****@discus sions.microsoft .com> skrev i en meddelelse
news:95******** *************** ***********@mic rosoft.com...
I have had this same problem, and have found that the following workaround is reasonably successful:

In every constructor of every form, as the first statement after the call to InitializeCompo nent () add:

SizeF sf = Form.GetAutoSca leSize (this.Font);
this.AutoScaleB aseSize = sf.ToSize ();

I created a class with a static method so I can make it in one line, since
it is used a lot:

this.AutoScaleB aseSize = autoScaleHelpCl ass.GetBaseSize (this.Font);
After adding this, my app works pretty well among large and small font
systems, at multiple resolutions. Not perfect, but pretty good.

Hope this helps.
John
"M O J O" wrote:
Hi,

I have my windows-display-font-size set to "Large fonts" and I've created a new project with two forms. Both of them are 600 width and 400 height. One have autoscale=true and the other is false. When I run the project, the two forms shows the same size.

Now I open the project (in vs.net) on a computer with
windows-display-font-size set to "Small fonts" and my project is screwed up. Now the width is 501 and the height is 351????????!!!! ! When I run the
project, the form with autoscale=true is smaller, which I can understand.
My question is .... why isn't my form size 600x400 when I open it on a
computer with "Small fonts"? ... and how can I make it the same size?

Lets say two develloper worked on the same project. One use "Large fonts" and the other "Small fonts". How can I make vs.net show the forms at the
same size on both devellopers vs.net??

STRANGE! :o)

Thanks in advance!

M O J O

Jul 21 '05 #7
Hi Kevin,

I tried to upload a couple of gif files to show what I mean, but MS' server
rejected the attachments.... .hmmm.

I do not understand, that when I tell the form it should be 600x400 why the
form size changes under different font sizes.

The code you and John showed me only affects runtime, but in designtime
things look wird when going from "large fonts" to "small fonts".

M O J O

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> skrev i en meddelelse
news:Mg******** ******@cpmsftng xa10.phx.gbl...
Hi MOJO,

I agree with John, that we should also set AutoScaleBaseSi ze according to
the form font to resolve this issue. According to John's suggestion, we
have to add the following lines of code when form loads to make the form
fit.

SizeF sf = Form.GetAutoSca leSize (this.Font);
this.AutoScaleB aseSize = sf.ToSize ();
this.AutoScale = true;

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #8
Hi MOJO,

When fonts changes, we need to write additional codes to make size change
in design time. However, I think these codes are not provided in current
controls. So when the fonts changed when design time, there is no changes
of the size accordingly.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #9
Thank you for your answer.

M O J O

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> skrev i en meddelelse
news:cS******** ******@cpmsftng xa10.phx.gbl...
Hi MOJO,

When fonts changes, we need to write additional codes to make size change
in design time. However, I think these codes are not provided in current
controls. So when the fonts changed when design time, there is no changes
of the size accordingly.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #10

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

Similar topics

4
3661
by: Michel Joly de Lotbiniere | last post by:
I hope this is the correct newsgroup for this subject. The other day I came across a site www.safesquid.com that specified font-family:Terminal font-size:9pt in the inline css for command-line displays in the page content. On my Windows 2000 PC, Terminal is a bit-mapped font that comes in various fixed sizes. The rendering differences between Mozilla 1.7.2 (which is my default browser) and MS IE 6 (latest patches) are fully illustrated...
4
4947
by: Eric Eggermann | last post by:
Hello all, I'm building an app that lays out and prints flash cards. Now the card might be any size, but when the user is working on the card, I draw the preview isotropically, as large as possible. The user specifies a font size for the document, but I need to scale this for the preview. The scaling code I have is very close but not right. I can only notice that it's wrong occasionally when I have a piece of text that wraps, and the...
0
348
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 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)...
7
3813
by: jozsi | last post by:
hi i developed my application for window resolution 1280*1024 now i have a remote maschine using a window resolution of 1024*768 is there a easy way to scale alle the object in the form? tnx for help! greetings
4
3833
by: Bernie Yaeger | last post by:
I'd like to allow the user to zoom a window using a trackbar, say from 80% to 120% the size of the original window. I'm trying to do this with the following code, but it fails pretty miserably: (from the form) Dim per As Decimal per = CDec(zoomit.Value) setzoom(Me, Me.Font, per) ' per is the current value of the trackbar as a
9
225
by: M O J O | last post by:
Hi, I have my windows-display-font-size set to "Large fonts" and I've created a new project with two forms. Both of them are 600 width and 400 height. One have autoscale=true and the other is false. When I run the project, the two forms shows the same size. Now I open the project (in vs.net) on a computer with windows-display-font-size set to "Small fonts" and my project is screwed up. Now the width is 501 and the height is...
3
4523
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a runtime control to anchor properly? Second -- the program I'm writting is supposed to look like a dos application (long story). When the application is "Normal" aka a small window then everything looks great. But when I resize the window to...
0
1436
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 resizing to my form. but the main problem is how to resize controls which are embedded to the form ? after googeling and trying some kind of things, i got that the main problem of control resizing is control's font scaling. any idea how to scale the font...
2
3333
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 reader could work well is bar code is too small, I want to keep same font heigh but smaller font width? is it possible to do that?
0
9583
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
10210
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
10039
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
9990
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
8869
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...
1
7406
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
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
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
2
3560
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.