Groups | Blog | Home
all groups > vb.net > april 2004 >

vb.net : Center Text in Web Form Textbox


fripper
4/23/2004 11:05:02 PM
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 ...


Cor Ligthert
4/24/2004 10:31:48 AM
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
4/24/2004 12:16:03 PM

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

[quoted text, click to view]

hirf-spam-me-here NO[at]SPAM gmx.at
4/24/2004 12:44:13 PM
* "fripper" <fripper@insightbb.com> scripsit:
[quoted text, click to view]

I don't see that the web forms textbox has this property.

--
Herfried K. Wagner [MVP]
hirf-spam-me-here NO[at]SPAM gmx.at
4/24/2004 8:41:50 PM
* "fripper" <young@indiana.edu> scripsit:
[quoted text, click to view]

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

--
Herfried K. Wagner [MVP]
AddThis Social Bookmark Button