Question: TextBox - Can't Align Center

V

VB Programmer

I cant 'align center' a text box.

First of all, all the justifications (left, center, right) on the toolbar
are dimmed. Why?

Also, when I try to do it through HTML (wrapping the control in a <p
align="center"><asp:TextBox ...></p>) this doesn't work either.

Any ideas?

Thanks.
 
F

Francis Shanahan

Do you want the text in the text box to be centered in the textbox? If so I
don't think HTML supports this.
<P align="center"><asp:TextBox id="TextBox1"
runat="server"></asp:TextBox></P>

This works for me.

Perhaps other areas on the page are throwing off the alignment?
 
A

Anthony Williams

You can either give your textbox a CSS class:

// Class Method
..MyTextBox {
text-align: center;
}

Alternatively, you could simply apply the following style to the textbox:

MyTextBox.Attributes.Add("style","text-align: center")
 
G

Grant

I just highlight it like you would to a paragraph in MS word, the buttons
will become undimmed.
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top