15,906,708 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11659261 (Top 11 by date)
Member 11659261
29-May-23 12:18pm
View
Thanks for all your help, it really is appreciated.
You fixed the listbox highlight colour issue, only the reversion to blue for a selected item in the listbox remains.
I may have to pursuade the client that this isn't an issue given that the highlight colour has been fixed by you.
Thanks again!
Member 11659261
29-May-23 9:19am
View
Unfortunately WebForms doesn't always use the same methods and properties for controls as a .Net Framework website (this site is over 20 years old).
There are a lot of differences between how the controls work and some that have extended properties, etc, in WebForms have fewer methods and properties in a website project.
Also, I'm working on an old site coded entirely in Visual Basic.
I created a new Visual Basic Web Application (.Net Framework) with an Empty project template to try the C# code (converted to Visual Basic) in the updated solution, but it doesn't work.
The listbox still uses the Chrome default colour.
Member 11659261
29-May-23 3:47am
View
It's a web site (e.g. a Web Project), not WebForms or MVC.
Member 11659261
29-May-23 3:10am
View
I'm using .Net Framework v4.7 for a web site, with Google Chrome as the browser (I've also tried FireFox too).
Member 11659261
28-May-23 9:46am
View
Yes, I thought I might have something else interfering with the solution you suggested, so I set up the .aspx page with just two objects, an '<asp:listbox>' and an HTML '<select>' control.
With all other CSS eliminated and just the CSS for the 'listbox' (with the various options) the '<select>' list box works fine - when the item is highlighted it's in the correct colour, but the <asp:listbox> doesn't work in the same way, it retains the Chrome Blue background for the highlighted item.
Finally, I noticed that in the CodePen.io example, when you select an item in the list, then go back to reselect another item the list, the original item is already highlighted in blue, even though none of the code refers to blue for a selected item. This is why I'm thinking that it's a browser issue.
Member 11659261
28-May-23 4:43am
View
Thanks for the example.
I think the problem is that, as stated in the question, I'm using an <asp:listbox>, not an HTML .
Perhaps it's the ASP.Net implementation of the listbox that prevents the CSS from working?
Member 11659261
27-May-23 16:22pm
View
No, sadly that doesn't work either.
Adding option:checked:hover with the box-shadow etc doesn't do anything to the items in the listbox when they are highlighted because the mouse is over them. Google Chrome Blue still rules for each highlighted option on the list.
Member 11659261
27-May-23 9:48am
View
Ah, I wish it was staring at me.
This doesn't do it, the colour of the highlighted item (as the mouse moves up and down the list contents) remains stubbornly in the blue of Google Chrome and doesn't change.
Member 11659261
27-May-23 9:26am
View
Unfortunately this changes the colour of all the items in the listbox.
I only want to change the colour of the item highlighted in the listbox when the mouse moves over it.
Member 11659261
27-May-23 7:30am
View
Apologies, I've updated the question with the inspection details
Member 11659261
16-Jun-15 14:17pm
View
Unfortunately these solutions are for a complex javascript solution whereas the .Net Framework 4.5 already has the solution in the form of the '.frozen' property of the GridView Column, I just can't get it to work.
I've checked that IIS is running v4.5 - it shows v4 when the page fails to compile, but I understand that's normal, for some reason IIS error messages show v4 even if v4.5 is being used.
Show More