Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to change the Selected Item's forecolor in ListBox-URGENT

Reply
Thread Tools

How to change the Selected Item's forecolor in ListBox-URGENT

 
 
Divya
Guest
Posts: n/a
 
      07-26-2005
Hi,


When a listbox's Enabled property is set to false the control is greyed
out to show that the control is
disabled/read-only. However, when the control is disabled
and an item is selected you can barely see the text that
is selected . Is it possible to change
the SelectedItem's forecolor to perhaps white and leave
the unselected ones grey when the control's Enabled
property is set to false.


Thanks,
Divya

 
Reply With Quote
 
 
 
 
Marcel
Guest
Posts: n/a
 
      08-01-2005
You can use something like:

<option style="background-color:red">Selected</option>

Marcel van Eijkel
(www.vaneijkel.com)

 
Reply With Quote
 
 
 
 
Andrew Backer
Guest
Posts: n/a
 
      08-01-2005
I do belive it is possible, though I haven't tried it Something
like this code should work, though of course you will have to determine
when to set it, and replace with your own listbox

ListItem itm = myList.Items[ myList.SelectedIndex ];
itm.Attributes.CssStyle.Add("color:white");

- Andrew
<no website to plug>
ps. post useful answers, M. this is a webcontrols forum.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Dot Net Cell Color forecolor change manoj kumar via .NET 247 ASP .Net 0 03-15-2005 11:08 AM
Change ForeColor of asp.net text box Jim ASP .Net 1 01-23-2005 01:24 AM
Re: change forecolor of a data in datalist Enrique Santa Cruz ASP .Net 0 11-04-2004 07:50 PM
Change forecolor for individual listitems in CheckBoxList Eric Robishaw ASP .Net 1 12-27-2003 07:50 PM



Advertisments