hello all,
am using asp.net vb . i have a label named label1 but i am passing data into it at runtime which depends on what the user clicks.
My problem now is that
1. How do i do autosize for the label because its not in the label properties

2. how do i align the text in the label

please help

hello all,
am using asp.net vb . i have a label named label1 but i am passing data into it at runtime which depends on what the user clicks.
My problem now is that
1. How do i do autosize for the label because its not in the label properties

2. how do i align the text in the label

please help

For #1:
I think, you don't need anything to autosize it, because it's automatically autosize. Make Width property null or blank.

for #2:
In my way, I use ClassCSS property.
I created CSS file (Style.css) like this:

Span.RFS
{
	direction:rtl;
	background-color:White;	 
}

than in ASPX designer form

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Browse.aspx.vb" Inherits="Browse" EnableSessionState="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Browse</title> 
    [B]<link href="../Style.css" type="text/css" rel="stylesheet" />[/B]
</head>
<body>
    <form id="form1" runat="server" >
    <asp:Label ID="Label1" runat="server" BackColor="#FFFFC0" CssClass="RFS"></asp:Label>
    </form>
 </body>  
</html>

hai,
there is nothing to resize for label. It will get resized automatically. Remove the width you have assigned for it and try.
You can write a css for text align like

label.text{text-align: right}

then call it with the css class.

thanks,
Shenu

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.