Home All Groups Group Topic Archive Search About
Author
21 Mar 2006 11:56 PM
Coleen
Using Vb.Net v1.1, I have several aspx controls (textboxes, listboxes,
dropdown lists) that I need to align the text within the control...

I've tried:

lst.Attributes.Add("style", "text-align: center;")

in the code-behind, and it does not work.   I have also tried setting the
index and doing it on PreRender (like you would for a datagrid) but I get an
error "Item' is not a member of System.EventArgs" on this:

Dim item As ListBox = CType(e.Item, ListBox)

Does anyone have any suggestions for something that OUGHT to be simple?

TIA,

Coleen

Author
22 Mar 2006 12:03 PM
CaffieneRush@gmail.com
I use the Style member of WebControl to style the control rather than
use the Attributes member directly.

Dim currencyBox1 as TextBox
'Align text within currencybox to the right.
currencyBox1.Style.Add("Text-Align", "right")
Author
22 Mar 2006 4:51 PM
Coleen
Thanks!  Just a variation of what I was trying, but it DOES work!  Thank you
very much!

<CaffieneR***@gmail.com> wrote in message
Show quoteHide quote
news:1143028983.518433.299810@g10g2000cwb.googlegroups.com...
> I use the Style member of WebControl to style the control rather than
> use the Attributes member directly.
>
> Dim currencyBox1 as TextBox
> 'Align text within currencybox to the right.
> currencyBox1.Style.Add("Text-Align", "right")
>
Author
22 Mar 2006 8:08 PM
CaffieneRush@gmail.com
My pleasure.
Author
9 May 2006 7:06 PM
Robert W.
This is exactly what I want to do with a 'Month Year' listbox I've just
added.  So I used your code as follows:

listBoxDates.Style.Add("Text-Align", "right");

But it didn't change anything.  Any idea why?


--
Robert W.
Vancouver, BC
www.mwtech.com



Show quoteHide quote
"CaffieneR***@gmail.com" wrote:

> My pleasure.
>
>