Listview Highlight

  • Thread starter Devron Blatchford
  • Start date
D

Devron Blatchford

Hi there,

Just wondering if I change the back and fore colour of a listview item when
the mouse hovers over it? I want to overide the default windows colour.

Can someone please tell me how to do this?

Thanks
Devron
 
J

Jeffrey Tan[MSFT]

Hi Devron,

I think you should do some hit-test yourself to determine the mouse is over
which item.
You can handle your hit-test code in MouseHover event, if you want to
change its color not imediatly.
If you want the item's color change imediatly, you can refer to the
MouseEnter and MouseLeave event.

If you still have any unclear, please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| Subject: Listview Highlight
| Date: Thu, 9 Oct 2003 10:09:42 +0930
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145204
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi there,
|
| Just wondering if I change the back and fore colour of a listview item
when
| the mouse hovers over it? I want to overide the default windows colour.
|
| Can someone please tell me how to do this?
|
| Thanks
| Devron
|
|
|
 
J

Jeffrey Tan[MSFT]

Hi Devron,

Hit-test means that you calculate the mouse point is over which item by the
mouse's x, y coordinate and the height, width of every item.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Newsgroups: microsoft.public.dotnet.languages.vb
| From: (e-mail address removed) (Jeffrey Tan[MSFT])
| Organization: Microsoft
| Date: Thu, 09 Oct 2003 02:42:05 GMT
| Subject: RE: Listview Highlight
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
|
|
| Hi Devron,
|
| I think you should do some hit-test yourself to determine the mouse is
over
| which item.
| You can handle your hit-test code in MouseHover event, if you want to
| change its color not imediatly.
| If you want the item's color change imediatly, you can refer to the
| MouseEnter and MouseLeave event.
|
| If you still have any unclear, please feel free to let me know.
|
| Best regards,
| Jeffrey Tan
| Microsoft Online Partner Support
| Get Secure! - www.microsoft.com/security
| This posting is provided "as is" with no warranties and confers no rights.
|
| --------------------
| | From: "Devron Blatchford" <[email protected]>
| | Subject: Listview Highlight
| | Date: Thu, 9 Oct 2003 10:09:42 +0930
| | Lines: 11
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| | Message-ID: <#[email protected]>
| | Newsgroups: microsoft.public.dotnet.languages.vb
| | NNTP-Posting-Host: 203.108.249.179
| | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145204
| | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| |
| | Hi there,
| |
| | Just wondering if I change the back and fore colour of a listview item
| when
| | the mouse hovers over it? I want to overide the default windows colour.
| |
| | Can someone please tell me how to do this?
| |
| | Thanks
| | Devron
| |
| |
| |
|
 
D

Devron Blatchford

Ok, that great and I can do that.

Just one question. How do I stop the item being highlighted with the default
blue once it is selected or change the default windows blue to another
color?

Thanks
Devron
 
J

Jeffrey Tan[MSFT]

Hi Devron,

It seems that when you select the item, its backcolor and forecolor will
both been cleared and display the color of the system color(I mean the
default selected mode item color ), so it needs not extra handle.

For your second "change the default windows blue to another", I do not
quite understand, can you explain to me more clear?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Thu, 9 Oct 2003 12:56:38 +0930
| Lines: 91
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145221
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Ok, that great and I can do that.
|
| Just one question. How do I stop the item being highlighted with the
default
| blue once it is selected or change the default windows blue to another
| color?
|
| Thanks
| Devron
|
|
| | >
| > Hi Devron,
| >
| > Hit-test means that you calculate the mouse point is over which item by
| the
| > mouse's x, y coordinate and the height, width of every item.
| >
| > Hope this helps,
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | From: (e-mail address removed) (Jeffrey Tan[MSFT])
| > | Organization: Microsoft
| > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | Subject: RE: Listview Highlight
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > |
| > |
| > | Hi Devron,
| > |
| > | I think you should do some hit-test yourself to determine the mouse is
| > over
| > | which item.
| > | You can handle your hit-test code in MouseHover event, if you want to
| > | change its color not imediatly.
| > | If you want the item's color change imediatly, you can refer to the
| > | MouseEnter and MouseLeave event.
| > |
| > | If you still have any unclear, please feel free to let me know.
| > |
| > | Best regards,
| > | Jeffrey Tan
| > | Microsoft Online Partner Support
| > | Get Secure! - www.microsoft.com/security
| > | This posting is provided "as is" with no warranties and confers no
| rights.
| > |
| > | --------------------
| > | | From: "Devron Blatchford" <[email protected]>
| > | | Subject: Listview Highlight
| > | | Date: Thu, 9 Oct 2003 10:09:42 +0930
| > | | Lines: 11
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | | Message-ID: <#[email protected]>
| > | | Newsgroups: microsoft.public.dotnet.languages.vb
| > | | NNTP-Posting-Host: 203.108.249.179
| > | | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.vb:145204
| > | | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | |
| > | | Hi there,
| > | |
| > | | Just wondering if I change the back and fore colour of a listview
item
| > | when
| > | | the mouse hovers over it? I want to overide the default windows
| colour.
| > | |
| > | | Can someone please tell me how to do this?
| > | |
| > | | Thanks
| > | | Devron
| > | |
| > | |
| > | |
| > |
| >
|
|
|
 
D

Devron Blatchford

Basically I want to sepcify the selected colours myself insted of using the
default windows colours. I can change the item colours but the selected
color is always the default system selected colour.

I want to ovewrite this.

Thanks
Devron



Jeffrey Tan said:
Hi Devron,

It seems that when you select the item, its backcolor and forecolor will
both been cleared and display the color of the system color(I mean the
default selected mode item color ), so it needs not extra handle.

For your second "change the default windows blue to another", I do not
quite understand, can you explain to me more clear?

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Thu, 9 Oct 2003 12:56:38 +0930
| Lines: 91
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145221
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Ok, that great and I can do that.
|
| Just one question. How do I stop the item being highlighted with the
default
| blue once it is selected or change the default windows blue to another
| color?
|
| Thanks
| Devron
|
|
| | >
| > Hi Devron,
| >
| > Hit-test means that you calculate the mouse point is over which item by
| the
| > mouse's x, y coordinate and the height, width of every item.
| >
| > Hope this helps,
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | From: (e-mail address removed) (Jeffrey Tan[MSFT])
| > | Organization: Microsoft
| > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | Subject: RE: Listview Highlight
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > |
| > |
| > | Hi Devron,
| > |
| > | I think you should do some hit-test yourself to determine the mouse is
| > over
| > | which item.
| > | You can handle your hit-test code in MouseHover event, if you want to
| > | change its color not imediatly.
| > | If you want the item's color change imediatly, you can refer to the
| > | MouseEnter and MouseLeave event.
| > |
| > | If you still have any unclear, please feel free to let me know.
| > |
| > | Best regards,
| > | Jeffrey Tan
| > | Microsoft Online Partner Support
| > | Get Secure! - www.microsoft.com/security
| > | This posting is provided "as is" with no warranties and confers no
| rights.
| > |
| > | --------------------
| > | | From: "Devron Blatchford" <[email protected]>
| > | | Subject: Listview Highlight
| > | | Date: Thu, 9 Oct 2003 10:09:42 +0930
| > | | Lines: 11
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | | Message-ID: <#[email protected]>
| > | | Newsgroups: microsoft.public.dotnet.languages.vb
| > | | NNTP-Posting-Host: 203.108.249.179
| > | | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.vb:145204
| > | | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | |
| > | | Hi there,
| > | |
| > | | Just wondering if I change the back and fore colour of a listview
item
| > | when
| > | | the mouse hovers over it? I want to overide the default windows
| colour.
| > | |
| > | | Can someone please tell me how to do this?
| > | |
| > | | Thanks
| > | | Devron
| > | |
| > | |
| > | |
| > |
| >
|
|
|
 
J

Jeffrey Tan[MSFT]

Hi Devron,

I got it.
Because change the system color will effect all the control in the system,
I think you should do the owner-draw to the ListView Control yourself.
To do ListView owner-draw in .Net C#, you can refer to this document:
http://dotnetclient/Whidbey/Runtime Specs/OwnerDraw.doc

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Fri, 10 Oct 2003 13:14:36 +0930
| Lines: 151
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145570
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Basically I want to sepcify the selected colours myself insted of using
the
| default windows colours. I can change the item colours but the selected
| color is always the default system selected colour.
|
| I want to ovewrite this.
|
| Thanks
| Devron
|
|
|
| | >
| > Hi Devron,
| >
| > It seems that when you select the item, its backcolor and forecolor will
| > both been cleared and display the color of the system color(I mean the
| > default selected mode item color ), so it needs not extra handle.
| >
| > For your second "change the default windows blue to another", I do not
| > quite understand, can you explain to me more clear?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Devron Blatchford" <[email protected]>
| > | References: <#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Listview Highlight
| > | Date: Thu, 9 Oct 2003 12:56:38 +0930
| > | Lines: 91
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 203.108.249.179
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145221
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Ok, that great and I can do that.
| > |
| > | Just one question. How do I stop the item being highlighted with the
| > default
| > | blue once it is selected or change the default windows blue to another
| > | color?
| > |
| > | Thanks
| > | Devron
| > |
| > |
| > | | > | >
| > | > Hi Devron,
| > | >
| > | > Hit-test means that you calculate the mouse point is over which item
| by
| > | the
| > | > mouse's x, y coordinate and the height, width of every item.
| > | >
| > | > Hope this helps,
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | From: (e-mail address removed) (Jeffrey Tan[MSFT])
| > | > | Organization: Microsoft
| > | > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | > | Subject: RE: Listview Highlight
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain
| > | > | Content-Transfer-Encoding: 7bit
| > | > |
| > | > |
| > | > | Hi Devron,
| > | > |
| > | > | I think you should do some hit-test yourself to determine the
mouse
| is
| > | > over
| > | > | which item.
| > | > | You can handle your hit-test code in MouseHover event, if you want
| to
| > | > | change its color not imediatly.
| > | > | If you want the item's color change imediatly, you can refer to
the
| > | > | MouseEnter and MouseLeave event.
| > | > |
| > | > | If you still have any unclear, please feel free to let me know.
| > | > |
| > | > | Best regards,
| > | > | Jeffrey Tan
| > | > | Microsoft Online Partner Support
| > | > | Get Secure! - www.microsoft.com/security
| > | > | This posting is provided "as is" with no warranties and confers no
| > | rights.
| > | > |
| > | > | --------------------
| > | > | | From: "Devron Blatchford" <[email protected]>
| > | > | | Subject: Listview Highlight
| > | > | | Date: Thu, 9 Oct 2003 10:09:42 +0930
| > | > | | Lines: 11
| > | > | | X-Priority: 3
| > | > | | X-MSMail-Priority: Normal
| > | > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | | Message-ID: <#[email protected]>
| > | > | | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | | NNTP-Posting-Host: 203.108.249.179
| > | > | | Path:
| cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.languages.vb:145204
| > | > | | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | |
| > | > | | Hi there,
| > | > | |
| > | > | | Just wondering if I change the back and fore colour of a
listview
| > item
| > | > | when
| > | > | | the mouse hovers over it? I want to overide the default windows
| > | colour.
| > | > | |
| > | > | | Can someone please tell me how to do this?
| > | > | |
| > | > | | Thanks
| > | > | | Devron
| > | > | |
| > | > | |
| > | > | |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
F

FM

that links is bogus



Jeffrey Tan said:
Hi Devron,

I got it.
Because change the system color will effect all the control in the system,
I think you should do the owner-draw to the ListView Control yourself.
To do ListView owner-draw in .Net C#, you can refer to this document:
http://dotnetclient/Whidbey/Runtime Specs/OwnerDraw.doc

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Fri, 10 Oct 2003 13:14:36 +0930
| Lines: 151
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145570
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Basically I want to sepcify the selected colours myself insted of using
the
| default windows colours. I can change the item colours but the selected
| color is always the default system selected colour.
|
| I want to ovewrite this.
|
| Thanks
| Devron
|
|
|
| | >
| > Hi Devron,
| >
| > It seems that when you select the item, its backcolor and forecolor will
| > both been cleared and display the color of the system color(I mean the
| > default selected mode item color ), so it needs not extra handle.
| >
| > For your second "change the default windows blue to another", I do not
| > quite understand, can you explain to me more clear?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Devron Blatchford" <[email protected]>
| > | References: <#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Listview Highlight
| > | Date: Thu, 9 Oct 2003 12:56:38 +0930
| > | Lines: 91
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 203.108.249.179
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145221
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Ok, that great and I can do that.
| > |
| > | Just one question. How do I stop the item being highlighted with the
| > default
| > | blue once it is selected or change the default windows blue to another
| > | color?
| > |
| > | Thanks
| > | Devron
| > |
| > |
| > | | > | >
| > | > Hi Devron,
| > | >
| > | > Hit-test means that you calculate the mouse point is over which item
| by
| > | the
| > | > mouse's x, y coordinate and the height, width of every item.
| > | >
| > | > Hope this helps,
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | From: (e-mail address removed) (Jeffrey Tan[MSFT])
| > | > | Organization: Microsoft
| > | > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | > | Subject: RE: Listview Highlight
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain
| > | > | Content-Transfer-Encoding: 7bit
| > | > |
| > | > |
| > | > | Hi Devron,
| > | > |
| > | > | I think you should do some hit-test yourself to determine the
mouse
| is
| > | > over
| > | > | which item.
| > | > | You can handle your hit-test code in MouseHover event, if you want
| to
| > | > | change its color not imediatly.
| > | > | If you want the item's color change imediatly, you can refer to
the
| > | > | MouseEnter and MouseLeave event.
| > | > |
| > | > | If you still have any unclear, please feel free to let me know.
| > | > |
| > | > | Best regards,
| > | > | Jeffrey Tan
| > | > | Microsoft Online Partner Support
| > | > | Get Secure! - www.microsoft.com/security
| > | > | This posting is provided "as is" with no warranties and confers no
| > | rights.
| > | > |
| > | > | --------------------
| > | > | | From: "Devron Blatchford" <[email protected]>
| > | > | | Subject: Listview Highlight
| > | > | | Date: Thu, 9 Oct 2003 10:09:42 +0930
| > | > | | Lines: 11
| > | > | | X-Priority: 3
| > | > | | X-MSMail-Priority: Normal
| > | > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | | Message-ID: <#[email protected]>
| > | > | | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | | NNTP-Posting-Host: 203.108.249.179
| > | > | | Path:
| cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.languages.vb:145204
| > | > | | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | |
| > | > | | Hi there,
| > | > | |
| > | > | | Just wondering if I change the back and fore colour of a
listview
| > item
| > | > | when
| > | > | | the mouse hovers over it? I want to overide the default windows
| > | colour.
| > | > | |
| > | > | | Can someone please tell me how to do this?
| > | > | |
| > | > | | Thanks
| > | > | | Devron
| > | > | |
| > | > | |
| > | > | |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
J

John Eikanger [MSFT]

Hi, FM

Thanks for the heads up. I'll make sure Jeffrey knows about it.

Thanks

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.

--------------------
| From: "FM" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Fri, 10 Oct 2003 11:55:40 -0400
| Lines: 211
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <u#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: pool-141-150-215-203.delv.east.verizon.net
141.150.215.203
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145722
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| that links is bogus
|
|
|
| | >
| > Hi Devron,
| >
| > I got it.
| > Because change the system color will effect all the control in the
system,
| > I think you should do the owner-draw to the ListView Control yourself.
| > To do ListView owner-draw in .Net C#, you can refer to this document:
| > http://dotnetclient/Whidbey/Runtime Specs/OwnerDraw.doc
| >
| > Hope this helps,
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Devron Blatchford" <[email protected]>
| > | References: <#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Listview Highlight
| > | Date: Fri, 10 Oct 2003 13:14:36 +0930
| > | Lines: 151
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 203.108.249.179
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145570
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Basically I want to sepcify the selected colours myself insted of
using
| > the
| > | default windows colours. I can change the item colours but the
selected
| > | color is always the default system selected colour.
| > |
| > | I want to ovewrite this.
| > |
| > | Thanks
| > | Devron
| > |
| > |
| > |
| > | | > | >
| > | > Hi Devron,
| > | >
| > | > It seems that when you select the item, its backcolor and forecolor
| will
| > | > both been cleared and display the color of the system color(I mean
the
| > | > default selected mode item color ), so it needs not extra handle.
| > | >
| > | > For your second "change the default windows blue to another", I do
not
| > | > quite understand, can you explain to me more clear?
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Devron Blatchford" <[email protected]>
| > | > | References: <#[email protected]>
| > | > <[email protected]>
| > | > <[email protected]>
| > | > | Subject: Re: Listview Highlight
| > | > | Date: Thu, 9 Oct 2003 12:56:38 +0930
| > | > | Lines: 91
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | NNTP-Posting-Host: 203.108.249.179
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.vb:145221
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | Ok, that great and I can do that.
| > | > |
| > | > | Just one question. How do I stop the item being highlighted with
the
| > | > default
| > | > | blue once it is selected or change the default windows blue to
| another
| > | > | color?
| > | > |
| > | > | Thanks
| > | > | Devron
| > | > |
| > | > |
message
| > | > | | > | > | >
| > | > | > Hi Devron,
| > | > | >
| > | > | > Hit-test means that you calculate the mouse point is over which
| item
| > | by
| > | > | the
| > | > | > mouse's x, y coordinate and the height, width of every item.
| > | > | >
| > | > | > Hope this helps,
| > | > | > Best regards,
| > | > | > Jeffrey Tan
| > | > | > Microsoft Online Partner Support
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | > This posting is provided "as is" with no warranties and confers
no
| > | > rights.
| > | > | >
| > | > | > --------------------
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | > | From: (e-mail address removed) (Jeffrey Tan[MSFT])
| > | > | > | Organization: Microsoft
| > | > | > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | > | > | Subject: RE: Listview Highlight
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | > | MIME-Version: 1.0
| > | > | > | Content-Type: text/plain
| > | > | > | Content-Transfer-Encoding: 7bit
| > | > | > |
| > | > | > |
| > | > | > | Hi Devron,
| > | > | > |
| > | > | > | I think you should do some hit-test yourself to determine the
| > mouse
| > | is
| > | > | > over
| > | > | > | which item.
| > | > | > | You can handle your hit-test code in MouseHover event, if you
| want
| > | to
| > | > | > | change its color not imediatly.
| > | > | > | If you want the item's color change imediatly, you can refer
to
| > the
| > | > | > | MouseEnter and MouseLeave event.
| > | > | > |
| > | > | > | If you still have any unclear, please feel free to let me
know.
| > | > | > |
| > | > | > | Best regards,
| > | > | > | Jeffrey Tan
| > | > | > | Microsoft Online Partner Support
| > | > | > | Get Secure! - www.microsoft.com/security
| > | > | > | This posting is provided "as is" with no warranties and
confers
| no
| > | > | rights.
| > | > | > |
| > | > | > | --------------------
| > | > | > | | From: "Devron Blatchford" <[email protected]>
| > | > | > | | Subject: Listview Highlight
| > | > | > | | Date: Thu, 9 Oct 2003 10:09:42 +0930
| > | > | > | | Lines: 11
| > | > | > | | X-Priority: 3
| > | > | > | | X-MSMail-Priority: Normal
| > | > | > | | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | | Message-ID: <#[email protected]>
| > | > | > | | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | > | | NNTP-Posting-Host: 203.108.249.179
| > | > | > | | Path:
| > | cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | > | | Xref: cpmsftngxa06.phx.gbl
| > | > microsoft.public.dotnet.languages.vb:145204
| > | > | > | | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | > | |
| > | > | > | | Hi there,
| > | > | > | |
| > | > | > | | Just wondering if I change the back and fore colour of a
| > listview
| > | > item
| > | > | > | when
| > | > | > | | the mouse hovers over it? I want to overide the default
| windows
| > | > | colour.
| > | > | > | |
| > | > | > | | Can someone please tell me how to do this?
| > | > | > | |
| > | > | > | | Thanks
| > | > | > | | Devron
| > | > | > | |
| > | > | > | |
| > | > | > | |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
J

Jeffrey Tan[MSFT]

Hi,

There is a .Net C# samples related to ListView ownerdraw,
here is the link:
http://www.codeproject.com/cs/miscctrl/customheader.asp?
print=true

Also, there is a Visual C++ sample, that is expose a full
ownerdraw feature:
http://www.codeguru.com/listview/supergrid.shtml

Hope all this helps, if you still have any questions,
please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and
confers no rights.

-----Original Message-----

Hi Devron,

I got it.
Because change the system color will effect all the control in the system,
I think you should do the owner-draw to the ListView Control yourself.
To do ListView owner-draw in .Net C#, you can refer to this document:
http://dotnetclient/Whidbey/Runtime Specs/OwnerDraw.doc

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Devron Blatchford" <[email protected]>
| References: <#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Listview Highlight
| Date: Fri, 10 Oct 2003 13:14:36 +0930
| Lines: 151
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 203.108.249.179
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl! TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145570
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Basically I want to sepcify the selected colours myself insted of using
the
| default windows colours. I can change the item colours but the selected
| color is always the default system selected colour.
|
| I want to ovewrite this.
|
| Thanks
| Devron
|
|
|
| | >
| > Hi Devron,
| >
| > It seems that when you select the item, its backcolor and forecolor will
| > both been cleared and display the color of the system color(I mean the
| > default selected mode item color ), so it needs not extra handle.
| >
| > For your second "change the default windows blue to another", I do not
| > quite understand, can you explain to me more clear?
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Devron Blatchford" <[email protected]>
| > | References: <#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Listview Highlight
| > | Date: Thu, 9 Oct 2003 12:56:38 +0930
| > | Lines: 91
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 203.108.249.179
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl! TK2MSFTNGP09.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:145221
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Ok, that great and I can do that.
| > |
| > | Just one question. How do I stop the item being highlighted with the
| > default
| > | blue once it is selected or change the default windows blue to another
| > | color?
| > |
| > | Thanks
| > | Devron
| > |
| > |
| > | | > | >
| > | > Hi Devron,
| > | >
| > | > Hit-test means that you calculate the mouse point is over which item
| by
| > | the
| > | > mouse's x, y coordinate and the height, width of every item.
| > | >
| > | > Hope this helps,
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | From: (e-mail address removed) (Jeffrey Tan [MSFT])
| > | > | Organization: Microsoft
| > | > | Date: Thu, 09 Oct 2003 02:42:05 GMT
| > | > | Subject: RE: Listview Highlight
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain
| > | > | Content-Transfer-Encoding: 7bit
| > | > |
| > | > |
| > | > | Hi Devron,
| > | > |
| > | > | I think you should do some hit-test yourself to determine the
mouse
| is
| > | > over
| > | > | which item.
| > | > | You can handle your hit-test code in MouseHover event, if you want
| to
| > | > | change its color not imediatly.
| > | > | If you want the item's color change imediatly, you can refer to
the
| > | > | MouseEnter and MouseLeave event.
| > | > |
| > | > | If you still have any unclear, please feel free to let me know.
| > | > |
| > | > | Best regards,
| > | > | Jeffrey Tan
| > | > | Microsoft Online Partner Support
| > | > | Get Secure! - www.microsoft.com/security
| > | > | This posting is provided "as is" with no warranties and confers no
| > | rights.
| > | > |
| > | > | --------------------
| > | > | | From: "Devron Blatchford"
 

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

Top