StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



How to resize a label to display all the text...Expand / Collapse
Author
Message
Posted 08/27/2007 5:08:19 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:31:07 PM
Posts: 1,241, Visits: 3,131
i have a label that holds the name of a process. It is possible that the name is too long to fit in the label. The label is not Autosized, and is anchored on the top, left and right, so it resizes within it's parent container (a splitter panel).

So, I'd like to be able to determine how long the text will be and either make the label larger (which just opens a whole pandoras box of issues, cause then a bunch of other stuff needs to be resized) or some other creative method to deal with this. Any ideas?
Post #11130
Posted 08/28/2007 10:14:54 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 2 days ago @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
Well, you could let it auto-size and put your controls in a TablePanel or FlowLayoutPanel which both handle re-arranging controls when the size of the controls change.  Or, you could just use the System.Drawing.Graphics.MeasureString() method and resize the label manually.  Or, rearrange your form so that you don't have anything to the right of the label (like with localized applications where the label is on top of the textbox rather than to the left of it) and let it grow to the appropriate size (within reason ).


www.bungie.net
Post #11165
Posted 08/28/2007 1:20:33 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:31:07 PM
Posts: 1,241, Visits: 3,131
Thanks Ben. I mull these options over.
Post #11180
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:59am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.