473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Listview - Change row color selected color


Hi,

Can anyone please help me ?

I would like to highlight a selected row in a listview ?
Can I chooce a custom color?


Thanks

John
Sep 16 '07 #1
2 14524
You will have to use custom drawing for that - see ListView.DrawItem event.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
---------
"John Devlon" <jo********@hotmail.comwrote in message
news:A_**********************@phobos.telenet-ops.be...
>
Hi,

Can anyone please help me ?

I would like to highlight a selected row in a listview ?
Can I chooce a custom color?


Thanks

John

Sep 17 '07 #2
If you don't have to choose a custom color, you can do it very simply. For
example Color. offers 134 choices; won't one of them be close enough? Then,
one line of code will set the backcolor and one one will set the forecolor as
in

lvCodeElts.Items(0).BackColor = Color.Coral

Just a suggestion to uncomplicate the matter.

HTH

Le*@KnowDotNet.com

Try our latest time saving tool, Visual Class Organizer, free for 30 days.

http://www.knowdotnet.com/articles/V...oductHome.html


"G Himangi" wrote:
You will have to use custom drawing for that - see ListView.DrawItem event.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
---------
"John Devlon" <jo********@hotmail.comwrote in message
news:A_**********************@phobos.telenet-ops.be...

Hi,

Can anyone please help me ?

I would like to highlight a selected row in a listview ?
Can I chooce a custom color?


Thanks

John


Sep 20 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Anderson | last post by:
Is there a style for a select option's "selected" color? For example: <HTML> <BODY> <FORM NAME="form1"> <SELECT NAME="mySelect" SIZE="7" style="background-color:red;"> <OPTION>Test 1...
2
by: TF | last post by:
Hi, Is there any way to change the text color of SOME of the ListBox(Windows Forms Control) items in VB.NET? TF
1
by: Bala | last post by:
How do i change the back color of messagebox
5
by: Jax | last post by:
Dear all, I have a list view, i dont like this list view very much anymore as it hasn't been the easiest object to use thus far. Now i like it even less. I have a problem with it, I wish to...
2
by: Sean | last post by:
Hi all, I have a treeview and because I subclass the treeview and allow multiple selection to be done on the treeview, I have a problem changing the background color of the treeview. The...
2
by: Alpha | last post by:
How do I change the selected item in a listbox according to a Combox's selected item on the same form? The Combox is from a different table in the same dataset as the Listbox uses. Combox's...
1
by: karunakar | last post by:
Hi All, I want to deselect the row in DATAGRID. in ASP.NET application. I was alredy selected in datagrid row .I want to change another row in same datgrid . Here in my datagrid was selected...
1
by: Antonio | last post by:
Hi, in my page's <body tag>'s "onload" javascript event I want to call a javascript method that will change the selected index of a drop down list. I want it to happen every time the page gets...
3
by: Julian Milano | last post by:
I'm using the following code to act on only the selected items in a listview. The items are selected via checkboxes: Dim indexes As ListView.SelectedIndexCollection = .SelectedIndices For Each i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.