Right Justify in TextBox

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

How can I right Justify something in a textbox? There seems to be no
property for that.
Thanks,
Gary
 
When I apply this do I have to edit the html or is there some way to deal
with the properties of the textbox. I don't see any style property.
Thanks,
Gary
 
When I apply this do I have to edit the html or is there some way to deal
with the properties of the textbox. I don't see any style property.
Thanks,
Gary
 
Hi Gary,

Thanks for your reply. The Style attribute is avaliable on html element
(html controls) such as
<input type="text" style="text-align:right;" .... >

For server control such as ASP.net TextBox, we need to set its css style
via code, for example in page_load, we can add the below code to add the
text-align style for a ASP.NET TextBox(txtServer)

private void Page_Load(object sender, System.EventArgs e)
{
txtServer.Style.Add("text-align","right");
}

Hope this helps.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

-------------------------------------------------------------------------
 
Back
Top