fitting label dimensions to length of string

M

Mike P

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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top