Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > fitting label dimensions to length of string

Reply
Thread Tools

fitting label dimensions to length of string

 
 
Mike P
Guest
Posts: n/a
 
      11-14-2008
I have a method that is returning a string which can be of any length.
Once this string is returned I want to display it on screen in a label
control. How can I make the label control's height and width be
flexible so that it always fits the length of the string it contains?

<asp:Label ID="lblSQL" runat="server" Height="600" Width="600"
BackColor="blue" ForeColor="white" Font-Names="Verdana"
Font-Size="Small"></asp:Label>

protected void Page_Load(object sender, EventArgs e)
{
ViewState["CountGUID"] = Request.QueryString["GUID"];

string strCountSQL =
GetCountSql(ViewState["CountGUID"].ToString());

lblSQL.Text = strCountSQL;
}




*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String exceeding length - Getting absolute string length james.w.appleby@gmail.com Java 5 01-11-2007 12:07 AM
Extract image dimensions (height, width) from Base64 String? Neo Geshel ASP .Net 0 02-19-2006 07:21 AM
label versus asp:label Question. Thanks. Shapper ASP .Net 2 05-07-2005 05:55 AM
left(string, length) or right(string, length)? Sam ASP .Net 3 02-17-2005 12:01 PM
How to get length of string? length() problems Mitchua Perl 5 07-17-2003 12:08 AM



Advertisments