473,378 Members | 1,631 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.

Label AutoSize property does not work properly

Hello:

I am trying to use Autosize=true on a long string and it
extends off of my form, rather than increasing the number
of lines of the Label as the documentation says it should
do.

Would anyone know what other property I need to set to get
this to work properly? I have looked through them all and
cant find any. PreferredHeight is read only.

thank you in advance.
Nov 22 '05 #1
2 6355
I have found when using labels with large amounts of text,
it's better to size it myself. If you size the control to
fit within an area that you're comfortable with, the
control behaves better with auto-size off. If you look at
the property description of AutoSize in the Property
sheet, it says "Enables automatic resizing based on font
size. Note that this is only valid for label controls
that don't wrap text.". I have no idea which label
controls do wrap text. The standard label provides no
capability for this. You could use a textbox control with
MultiLine = True and WordWrap set to true. That might
give you the desired effect. You could play with the
colors and lock it to make it appear to be a label. Just
a thought.
-----Original Message-----
Hello:

I am trying to use Autosize=true on a long string and it
extends off of my form, rather than increasing the number
of lines of the Label as the documentation says it should
do.

Would anyone know what other property I need to set to getthis to work properly? I have looked through them all andcant find any. PreferredHeight is read only.

thank you in advance.
.

Nov 22 '05 #2
I have found when using labels with large amounts of text,
it's better to size it myself. If you size the control to
fit within an area that you're comfortable with, the
control behaves better with auto-size off. If you look at
the property description of AutoSize in the Property
sheet, it says "Enables automatic resizing based on font
size. Note that this is only valid for label controls
that don't wrap text.". I have no idea which label
controls do wrap text. The standard label provides no
capability for this. You could use a textbox control with
MultiLine = True and WordWrap set to true. That might
give you the desired effect. You could play with the
colors and lock it to make it appear to be a label. Just
a thought.
-----Original Message-----
Hello:

I am trying to use Autosize=true on a long string and it
extends off of my form, rather than increasing the number
of lines of the Label as the documentation says it should
do.

Would anyone know what other property I need to set to getthis to work properly? I have looked through them all andcant find any. PreferredHeight is read only.

thank you in advance.
.

Nov 22 '05 #3

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

Similar topics

1
by: Harvey | last post by:
Hello: I am trying to use Autosize=true on a long string and it extends off of my form, rather than increasing the number of lines of the Label as the documentation says it should do. Would...
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...
0
by: Adonai | last post by:
Hi, I'm having an issue with this code that I'm writing, I'm curious as to why the windows form label (lblTime) isn't getting updated with the new variable when I use the timer. I made a blank form...
1
by: Weber Samuel | last post by:
Hi NG i try to catch the Application.Idle Event: --> Application.Idle += new EventHandler(OnIdle); Here's my problem: If i put a Label on my Form and set the Property AutoSize = true then...
2
by: Oenone | last post by:
I'm trying to create a form similar to a VB messagebox but with custom content. One of the things I want to be able to do is display some text in a label at the top of the messagebox form and have...
8
by: Jordi Rico | last post by:
Hi, I've made the next inherited class in Visual Studio 2005: Public Class LabelEx Inherits System.Windows.Forms.Label Sub New() MyBase.New() Me.ForeColor = Color.Black Me.AutoSize = False...
1
by: Patrick Lioi | last post by:
Label label = new Label(); label.Width = 1; label.AutoSize = true; label.Text = "A long string, requiring a width larger than 1."; //At this point, Width is still 1. What am I missing? ...
2
by: cj | last post by:
As I begin to do more and more with programs built from scratch in 2005 instead of those converted from 2003, I'm finding differences that are confusing. Why can't I set the size of a label in...
1
by: Ryou kaihou | last post by:
As we known, in Visual Stdio 2003 or 2005, the property of Autosize of Label is set to True by defaut, how can I customize this and set property of Autosize to False? Any ideas? Thanks
11
by: Peter Larsen [] | last post by:
Hi, I have two questions related to the Label control. How do i prevent the label from expand the canvas into 2 lines (word wrap) ?? At the moment i set AutoSize to false (to prevent the word...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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

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.