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

How do I determine if text fits into my label or not?

I have a label on a small form. I need to determine if the text in the
label fits in the label. My end goal is to reduce the font size of the text
in the label until it fits.

How can I do this via code?

Thanks,

-Dave
Nov 21 '05 #1
1 1518
"Dave" <no****@yahoo.com> schrieb:
I have a label on a small form. I need to determine if the text in the
label fits in the label. My end goal is to reduce the font size of the
text
in the label until it fits.


'Graphics.MeasureString' (see documentation).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2

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

Similar topics

3
by: Not Me | last post by:
Hi, I have a report, viewable in continuous form. I don't want the size of the report to change (it should fit address labels on the printer), but in order to minimise the space between empty...
2
by: Noah Coad [C# MCP] | last post by:
I'm creating a program the must show the time (a clock) in a user control and the text must fill the user control. How do I make text dynamically resize to fill a label/panel/usercontrol? ...
2
by: David Sworder | last post by:
Hi, A Windows form that I'm developing will have two controls: Label1 and Label2. Both controls are of type Label (go figure). The text of Label1 will not be known until runtime and may change...
2
by: CJack | last post by:
hi, i have a window form with different controls. i want to loop through all the controls and write the types and lables of each control in a file. I dnt know how to determine the type of a control...
2
by: John Baro | last post by:
If I have a label (AutoSize = false) with more text than can fit it wraps downwards. I need to determine how high the label needs to be to fit the whole of the text in. I can then put it into a...
7
by: Joe | last post by:
I have a label control that will be filled with text at runtime. The length of the text will vary, but the label must stay the same size. Is there a way to set the font size of the text such that...
7
by: Doru Roman | last post by:
Hi, What is the fastest way to evaluate manually the result in this case: int a, b, c; a = 255; b = 122; c = a & b; The only way I know is transforming each number into the binary value...
4
by: Sid Price | last post by:
I would like to have the text of a label resize to fit the label control itself. I understand that the other way around is possible, i.e. having the control resize to display the text (autosize...
13
by: softwaredoug | last post by:
I can't see to easily find this on google or in a newsgroup Is there a standard function/macro/whatever you can call and determine the distance in a C program how deep one is in the C call stack...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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...

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.