From: Luc on
Hi,

i want the first item in the dropdownlist to be red and bold (VB.net).
Red works, but not bold. An suggestion is welcome.
Thanks
Luc

z1 = New ListItem("choose an item", 0)
z1.Attributes.Add("style", "font-bold:true;background-color:red")
DropDownList1.Items.Add(z1)


From: Stefano Frosio on
> z1.Attributes.Add("style",
> "font-bold:true;background-color:red")

Use "font-weight:bold;background-color:red".

HTH,

--
Stefano Frosio
www.esse-effe.com


From: Luc on
thanks for answering, but i tried that too without succes ..

"Stefano Frosio" <stefanofrosioNIENTESPAM(a)GRAZIEgmail.com> schreef in
bericht news:4c668fff$0$18993$4fafbaef(a)reader5.news.tin.it...
>> z1.Attributes.Add("style", "font-bold:true;background-color:red")
>
> Use "font-weight:bold;background-color:red".
>
> HTH,
>
> --
> Stefano Frosio
> www.esse-effe.com
>


From: Registered User on
On Sat, 14 Aug 2010 15:52:41 +0200, "Luc" <ll(a)nospam> wrote:

>thanks for answering, but i tried that too without succes ..
>
I believe that style is a collection of attributes rather than a
specific attribute. In any case this is works for me.

z1.Attributes.Add("font-weight", "bold");
z1.Attributes.Add("background-color", "red");

regards
A.G.

>"Stefano Frosio" <stefanofrosioNIENTESPAM(a)GRAZIEgmail.com> schreef in
>bericht news:4c668fff$0$18993$4fafbaef(a)reader5.news.tin.it...
>>> z1.Attributes.Add("style", "font-bold:true;background-color:red")
>>
>> Use "font-weight:bold;background-color:red".
>>
>> HTH,
>>
>> --
>> Stefano Frosio
>> www.esse-effe.com
>>
>
From: Luc on
It still doesn't work to me.
I found this comment about this:

"Hi, you can not bold the list or combo box items invidually, even you can
not change the font styles of a single item except forecolors. "

Sure it works to you?

"Registered User" <n4jvp(a)ix.netcom.com> schreef in bericht
news:b4fd661vonr8b1vhphqv4vouplbssm212m(a)4ax.com...
> On Sat, 14 Aug 2010 15:52:41 +0200, "Luc" <ll(a)nospam> wrote:
>
>>thanks for answering, but i tried that too without succes ..
>>
> I believe that style is a collection of attributes rather than a
> specific attribute. In any case this is works for me.
>
> z1.Attributes.Add("font-weight", "bold");
> z1.Attributes.Add("background-color", "red");
>
> regards
> A.G.
>
>>"Stefano Frosio" <stefanofrosioNIENTESPAM(a)GRAZIEgmail.com> schreef in
>>bericht news:4c668fff$0$18993$4fafbaef(a)reader5.news.tin.it...
>>>> z1.Attributes.Add("style", "font-bold:true;background-color:red")
>>>
>>> Use "font-weight:bold;background-color:red".
>>>
>>> HTH,
>>>
>>> --
>>> Stefano Frosio
>>> www.esse-effe.com
>>>
>>


 |  Next  |  Last
Pages: 1 2
Prev: Deleting multiple rows in Datagrid
Next: New in VS 2008