473,320 Members | 1,828 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,320 software developers and data experts.

ListView Column COlor

I want to change the color of certain columns in my listview. I know it can
be done using customdraw, but I haven't found much code to help with it.
Any help in vb.net would be great.

TIA
Nov 21 '05 #1
3 11230
"Lespaul36" wrote:
I want to change the color of certain columns in my listview. I know it can
be done using customdraw, but I haven't found much code to help with it.
Any help in vb.net would be great.


Can you be more specific about what you mean by the color of the column? If
you are looking to change the color of the items in the column, ListViewItem
has ForeColor and BackColor properties that you can set.

If you want to change the color of the column header I believe that would be
a custom draw situation, but I am not experienced enough with that to provide
help.

-Brian
Nov 21 '05 #2
I want to have a gray rectangle on the background such as the one in Windows
Explorer when a column header is clicked.

"Brian Haynes" <Br*********@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
"Lespaul36" wrote:
I want to change the color of certain columns in my listview. I know it
can
be done using customdraw, but I haven't found much code to help with it.
Any help in vb.net would be great.


Can you be more specific about what you mean by the color of the column?
If
you are looking to change the color of the items in the column,
ListViewItem
has ForeColor and BackColor properties that you can set.

If you want to change the color of the column header I believe that would
be
a custom draw situation, but I am not experienced enough with that to
provide
help.

-Brian

Nov 21 '05 #3
Figured it out
SendMessage(lstView.Handle, LVM_SETSELECTEDCOLUMN, ColumnIndex, 0)

"Lespaul36" <le*******@none.net> wrote in message
news:Or**************@TK2MSFTNGP09.phx.gbl...
I want to have a gray rectangle on the background such as the one in
Windows Explorer when a column header is clicked.

"Brian Haynes" <Br*********@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
"Lespaul36" wrote:
I want to change the color of certain columns in my listview. I know it
can
be done using customdraw, but I haven't found much code to help with
it.
Any help in vb.net would be great.


Can you be more specific about what you mean by the color of the column?
If
you are looking to change the color of the items in the column,
ListViewItem
has ForeColor and BackColor properties that you can set.

If you want to change the color of the column header I believe that would
be
a custom draw situation, but I am not experienced enough with that to
provide
help.

-Brian


Nov 21 '05 #4

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

Similar topics

0
by: rmorvay | last post by:
I have successfully integrated sorting in the listview control with the following code: Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As...
6
by: Richard | last post by:
Hi. I use a ListView to display data in tabular form. Each ListView row corresponds to a data record. The ListView Item of the record is the record key or code. Each SubItem in that row...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
1
by: andrewcw | last post by:
The clcik event on the ListView control seems to trigger off the item level ( the first column ). I would like to be able to trap the click event on a particular subitem ( a specific column's row...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
5
by: billuy | last post by:
Is there a way to sort by a specified column in a listview? I'd like my users to be able to click on the column heading and have the listview sort by that column. Thanks, Billyb
12
by: Dennis | last post by:
I have a form which has a ListView control named ListView1 added at design time. When I add items using the following code, they don't appear in the list view. However, if I create a ListView...
12
by: J L | last post by:
When I fill a listview, I resize the columns to fit the data. I need to know if the data will fit vertically or if there will be a vertical scroll bar. I need to know this so I can allow for it on...
6
by: Dave | last post by:
VB6 has a SorkKey property that you can setup on the ListView control to tell the ListView what column to use for sorting. In .NET there is a Sort() method and a SortOrder property that you can...
2
by: GT | last post by:
Could someone please explain how to add images to a ListView other than in the first column?
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.