473,387 Members | 1,463 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.

Can't set size of label

cj
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 2005? I put it on
the form and try to set it's size to 72,16. It jumps right back to
39,13. In programs converted to 2005 from 2003 I don't have this
problem. What's up?

I am trying to build a form that looks like one in a 2003 program so I'm
adding the controls to the 2005 form and setting their position and size
to the values the controls have in the 2003 program I'm copying the look of.
Jan 2 '07 #1
2 9774
Make sure the AutoSize property for the label is set to False. Then you can
resize it as needed.

-----
Tim Patrick - www.timaki.com
Start-to-Finish Visual Basic 2005
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 2005? I
put it on the form and try to set it's size to 72,16. It jumps right
back to 39,13. In programs converted to 2005 from 2003 I don't have
this problem. What's up?

I am trying to build a form that looks like one in a 2003 program so
I'm adding the controls to the 2005 form and setting their position
and size to the values the controls have in the 2003 program I'm
copying the look of.

Jan 2 '07 #2
Hi Cj,

Happy New Year!

Yes, just as Tim pointed out, .Net2.0 introduced the AutoSize property for
all controls, which basically lets you tell the control that it should
resize to properly contain its contents - so Buttons and Labels will expand
if the text within them expands, Forms will grow larger if controls within
it grow, etc. This feature is asked by many developers in .Net1.1 world, so
the .Net winform team finally added them in .Net2.0.

.Net2.0 also introduced "auto-relocation" feature together with "AutoSize";
it is controlled by the AutoRelocate property, also on virtually all
controls.

Below is the official link described the these 2 new features in .Net2.0:
"Improved Layout ":
http://www.windowsforms.net/WhidbeyF...D=2&ItemID=17&
Cat=Runtime&tabindex=1

Hope it helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 3 '07 #3

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

Similar topics

7
by: jez123456 | last post by:
Hi, I have the following method where I need to display which database is being processed, however, the label lblDatabase dosn't seem to work until the end. private void...
2
by: Andy Sutorius | last post by:
Hi, Are datalists able to have labels inside of the ItemTemplate? Every time I try to place a label in the Item Template it does not show up in the code behind/intellisense. FYI the datalist...
4
by: Randy | last post by:
Hello, I don't see a wrap property for the ASP version of Label. Is there anyway this control can be set to not wrap? Thanks
0
by: Rob R. Ainscough | last post by:
Has anyone else had this problem? I'm in GridLayout, if I add a new Label control and try to move/position it to the bottom page using the arrow keys it just stops at the bottom and doesn't let...
2
by: Sjaakie Helderhorst | last post by:
Hi there, I created my own user control (myControl) containing: myCaption - docked top myGrid - docked.fill (datasource: myDataset) myPanel - docked bottom This control is added to the form:...
1
by: clintonG | last post by:
I'm having a problem with a label in a MasterPage which is not in a ContentPlaceHolder. The naughty label will not allow me to change its text property. <%-- renders the label's text directly to...
3
by: ASP Developer | last post by:
I have a variety of pages that use a master page. For some reason when I attempt to copy any of the label text on the screen it seems to highlight most of the screen randomly and I can't simply...
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...
0
by: sudhashekhar30 | last post by:
hi i m trying to set text property of label which is in content page from javascript function. function empcodesize() { var size=document.getElementById('<%=TxtempCode.ClientID...
7
JustJim
by: JustJim | last post by:
Hi all, My new assignment again involves someone else's database application - why do I get all the trouble-shooting jobs and never get to build from scratch? When I drag a fieldname from the...
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
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.