ASP .NET Users Desktop Themes

G

Guest

I am writing an ASP .NET application. Controls such as Listbox and combo box
pick up the Users Themes from there PC and display selected items using such
selected highlight colors.

I have a table which the user can scroll through and also has mousein -
mouseout events which changes the color as they scroll. This does not pick
up the user's theme color (it is defined in the style sheet). I would rather
this be the Users Theme color. Why? Because I have a table on the same page
as a Listbox and depending on the users theme, they both select with
different colors. It doesn't look nice

Question:
1. Is there a way to modify the listbox selected item color (I don't think
there is, unless I write a custom control, which is not an option). And I
mean the selected color (onclick), not background, forecolor). I know I could
use the html listbox and modify the style, however, there does not seem to be
a way to modify the 'selected item'

2. Is there an API call I can make (using VBSCRIPT on the client, or
JSCRIPT) that can pick up the users theme and get the 'selecteditem' color.

Its just cosmetics, but it makes a difference.
Thanks, Dianna
 
A

Alex

I do not think there is a way to override the system's Selected Item color.
Depending on your desktop theme, this color may vary, but I have not found a
way to alter this programatically. You can get each option's style or class
values using something like the following.

code to use onClick or onChange, ect.
this[selectedIndex].value;
this[selectedIndex].setAttribute('className','SelectedItem');
this[selectedIndex].getAttribute('className');

<select name="lstDepartment" size="1" multiple>
<option value="1" class="Item">Marketing</option>
<option value="2" class="Item">Sales</option>
<option value="4" class="Item">Executive</option>
<option value="5" class="Item">IT</option>
</select>
 
R

recoil

Not via Javascript. One would have to snoop at some obsecure registry
key or API call most likely to retrieve this information.
 
K

Karl Seguin

I agree with what the other posters have said...certainly can't access
user's theme via client script..perhaps an activex control however...as for
the highlighted colour, take a look at
http://www.mhavila.com.br/topicos/web/css_tabelas.html it's in spanish..but
if you scroll all the way down, you'll see a box with a different hover
highlight, which is achieved, I would assume, via the :hover CSS flag..

Karl
 
G

Guest

Thanks everyone.

Karl Seguin said:
I agree with what the other posters have said...certainly can't access
user's theme via client script..perhaps an activex control however...as for
the highlighted colour, take a look at
http://www.mhavila.com.br/topicos/web/css_tabelas.html it's in spanish..but
if you scroll all the way down, you'll see a box with a different hover
highlight, which is achieved, I would assume, via the :hover CSS flag..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top