473,772 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14548
You will have to use custom drawing for that - see ListView.DrawIt em 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).
EZNamespaceExte nsions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensio ns.Net : Develop all shell extensions,expl orer bars and BHOs
rapidly in .Net
---------
"John Devlon" <jo********@hot mail.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.Item s(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.DrawIt em 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).
EZNamespaceExte nsions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensio ns.Net : Develop all shell extensions,expl orer bars and BHOs
rapidly in .Net
---------
"John Devlon" <jo********@hot mail.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
102937
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 <OPTION>Test 2 <OPTION>Test 3 <OPTION>Test 4
2
12410
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
1930
by: Bala | last post by:
How do i change the back color of messagebox
5
5604
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 change the selected index (i set selected to 1 so it can only select one) but it keeps telling me it is read only. Surely there must be a way round this!?!?
2
4353
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 problem is that after I multi-select the treenodes, and I try to change the background color of the treeview, those treenodes that have been multi-selected before still
2
3331
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 ValueMember is a ID that is a column in the table that the listbox uses. Is there a way to link these 2's relation so that when the user changes the selection in the Combox the list box would automacticall changes to reflect the items that's linked to...
1
6636
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 in Multiple rows. when ever i select the particular row that time it can be selected .Next time i want to choose another datagrid row that time in My application first row also hilighted.(Here Multiple rows selected) that should not happen
1
16543
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 refreshed but not do it with codebehind, it has to be javascript. How do I do it?
3
1430
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 In indexes ActiveXFileName = .Items(i).ToString Call RegisterActiveXFile(ActiveXFileName) Next For some reason it does not work. Can someone explain why?
0
9619
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.