Center Text in Web Form Textbox

  • Thread starter Thread starter fripper
  • Start date Start date
F

fripper

How specifically can I center the text in a text box on a web form? I see
in VB .Net Help that a textbox has a horizontal align property but I don't
know how to access it.

Thanks ...
 
Hi Fripper,

I do not know so fast however this can help you, you can add a lot of
attributes to a webcontrol by doing something as this (my standard sample
for this)

\\\
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"
///

I hope this helps?

Cor
 
* "fripper said:
How specifically can I center the text in a text box on a web form? I see
in VB .Net Help that a textbox has a horizontal align property but I don't
know how to access it.

I don't see that the web forms textbox has this property.
 
You're right ... I was looking at Windows forms not Web forms! I have,
however, found a way to do what I wanted ... although it is very awkward. I
can go into the HTML code created for the web form and add "; TEXT-ALIGN:
center" to the end of the params in the STYLE section of the ASP line for
the textbox. It seems to work but surely there is a more user-friendly way
to do this.

Thanks for your reply
 
* "fripper said:
You're right ... I was looking at Windows forms not Web forms! I have,
however, found a way to do what I wanted ... although it is very awkward. I
can go into the HTML code created for the web form and add "; TEXT-ALIGN:
center" to the end of the params in the STYLE section of the ASP line for
the textbox. It seems to work but surely there is a more user-friendly way
to do this.

That's CSS and it will work, as you stated.
 
Back
Top