473,500 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Forms Font Resize

I'm interested in getting a Windows forms font to resize similar to what
happens with the Windows toolbars when the end-user changes the system font.
With the Windows toolbar, the font 'grows' as the user changes the computer
settings. I'm not interested in the event that fires, what I need is an
approach to setting the font that is not hard-coded to a specific size such
as 10 or 12. I don't see that available in .NET controls, am I missing
something? For the curious, this relates to an accessibility project I am
researching.
Dec 14 '07 #1
1 5749
Font sizes can be set in pixels or in points. When setting a font size all
you need to know is about how much vertical space you want the line to take
up. Remember that the font may actually take up more height than you ask for
because the measurement relates to the EM square and depending upon the
font, you may have to account for descenders and ascenders that project
outside of this area.

By default forms use an MS Sans Serif font and controls do not set a
specific value but, when the font size hasn't been set, take the font from
their parent. you may be able to use this to your advantage.

To understand the points, if you'll forgive the pun, a little better this
article may be of use. http://www.bobpowell.net/begintext.htm
--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"vapor" <va***@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
I'm interested in getting a Windows forms font to resize similar to what
happens with the Windows toolbars when the end-user changes the system
font.
With the Windows toolbar, the font 'grows' as the user changes the
computer
settings. I'm not interested in the event that fires, what I need is an
approach to setting the font that is not hard-coded to a specific size
such
as 10 or 12. I don't see that available in .NET controls, am I missing
something? For the curious, this relates to an accessibility project I am
researching.
Dec 15 '07 #2

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

Similar topics

55
4935
by: Haines Brown | last post by:
I've been setting font-size 1em; as the default in my style sheets. Until now, that seemed to be ok. But now I'm beginning to wonder. My aim is to have an easily readable, but not overly large...
0
2287
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
4
3129
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
44
9382
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
12
1907
by: newspost2000 | last post by:
http://www.htmldog.com/articles/elasticdesign/demo/ I found this wonderful site the demonstrates how you cannnot resize text formated using styles in ie 6 if you specify font size using pt units...
4
4153
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
2
1774
by: Emre Sevinc | last post by:
Hello, I have a strange situation. I create a very simple Windows Forms application and place the code below however even though I place breakpoints in various event handling points VS.NET 2005...
11
2512
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
In the plant, we have monitors that range in size, and we force our application to be full screen. The font for the screen has been designed for 800x600 screens, which is the smallest size...
6
8796
by: Miro | last post by:
Is there a way to / or a mathematical formula to see if a font size is 'too big' for a label. I have a label that is docked to 'fill' a form, and I want to resize that font based on the width...
0
7018
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
7232
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...
1
6906
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
7397
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
5490
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,...
1
4923
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...
0
4611
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...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1430
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 ...

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.