ListView Items - How to set colour ? 
Author Message
 ListView Items - How to set colour ?

In the VB6 control each ListItem.SubItem can be colored as you please..
I don't remember about the VB5 control but don't think so without API calls
(but I haven't looked at the VB5 Common Controls for awhile)..

VB6 code...
..........
        With ListView1.ListItems.Item(lngIndex)
            .ForeColor = vbRed
            .Selected = blnState
            .Checked = blnState
            With .ListSubItems
             .Item(1).Bold = True
             .Item(2).Bold = True
             .Item(1).ForeColor = vbRed
             .Item(2).ForeColor = vbGreen
        End With
...........
Neila
-----

Quote:

>Hi,
>I am writing a financial program which lists transactions in a
>ListView. I would like cheques to be red, cash out to be black and
>deposits to be green. I can use Icons, but the colour option is
>prefered by the users.
>Can anyone tell me if it is possible to set the colour of a listview
>item individually ?
>Any help appreciated.
>Regards,
>Rod.



Mon, 18 Mar 2002 03:00:00 GMT  
 ListView Items - How to set colour ?
Hi,
I am writing a financial program which lists transactions in a
ListView. I would like cheques to be red, cash out to be black and
deposits to be green. I can use Icons, but the colour option is
prefered by the users.
Can anyone tell me if it is possible to set the colour of a listview
item individually ?
Any help appreciated.
Regards,
Rod.


Tue, 19 Mar 2002 03:00:00 GMT  
 ListView Items - How to set colour ?
Rod,
What version on VB and what version of the CC Lib are you referencing?
The code I shot out was yanked right out of a little sample I wrote
recently.
OK, I just loaded the CC 5SP2 and the thing does NOT have the property ;-(
BUT the VB6 control does.  You might need to look around up at www.mvps.org
look at /vbnet and /bmtz .  I know that one of those sites (maybe both) has
the
entire Listview API wrapped up (by Brad Martinez) .  Look through that stuff
and see if you can get it to work.  Looks like the Common Controls are MUCH
improved in VB6 (as far as the properties/ methods and events exposed!!)
Neila

Quote:

>Hi Neila,
>Your assistance is appreciated, however I get the message "Method or
>data member not found" refering to .ListSubItems. Is it possible I
>have the wrong control ?

>If I key in :
>ListView1.ListItems(1).  the drop down box does not show
>.ListSubItems.

>Any clues ?
>Many thanks,
>Rod.

>On Thu, 30 Sep 1999 20:29:58 -0500, "Neila Nessa"

>>In the VB6 control each ListItem.SubItem can be colored as you please..
>>I don't remember about the VB5 control but don't think so without API
calls
>>(but I haven't looked at the VB5 Common Controls for awhile)..

>>VB6 code...
>>..........
>>        With ListView1.ListItems.Item(lngIndex)
>>            .ForeColor = vbRed
>>            .Selected = blnState
>>            .Checked = blnState
>>            With .ListSubItems
>>             .Item(1).Bold = True
>>             .Item(2).Bold = True
>>             .Item(1).ForeColor = vbRed
>>             .Item(2).ForeColor = vbGreen
>>        End With
>>...........
>>Neila
>>-----


>>>Hi,
>>>I am writing a financial program which lists transactions in a
>>>ListView. I would like cheques to be red, cash out to be black and
>>>deposits to be green. I can use Icons, but the colour option is
>>>prefered by the users.
>>>Can anyone tell me if it is possible to set the colour of a listview
>>>item individually ?
>>>Any help appreciated.
>>>Regards,
>>>Rod.



Mon, 08 Apr 2002 03:00:00 GMT  
 ListView Items - How to set colour ?
Hi Neila,
Your assistance is appreciated, however I get the message "Method or
data member not found" refering to .ListSubItems. Is it possible I
have the wrong control ?

If I key in :
ListView1.ListItems(1).  the drop down box does not show
.ListSubItems.

Any clues ?
Many thanks,
Rod.

On Thu, 30 Sep 1999 20:29:58 -0500, "Neila Nessa"

Quote:

>In the VB6 control each ListItem.SubItem can be colored as you please..
>I don't remember about the VB5 control but don't think so without API calls
>(but I haven't looked at the VB5 Common Controls for awhile)..

>VB6 code...
>..........
>        With ListView1.ListItems.Item(lngIndex)
>            .ForeColor = vbRed
>            .Selected = blnState
>            .Checked = blnState
>            With .ListSubItems
>             .Item(1).Bold = True
>             .Item(2).Bold = True
>             .Item(1).ForeColor = vbRed
>             .Item(2).ForeColor = vbGreen
>        End With
>...........
>Neila
>-----


>>Hi,
>>I am writing a financial program which lists transactions in a
>>ListView. I would like cheques to be red, cash out to be black and
>>deposits to be green. I can use Icons, but the colour option is
>>prefered by the users.
>>Can anyone tell me if it is possible to set the colour of a listview
>>item individually ?
>>Any help appreciated.
>>Regards,
>>Rod.



Tue, 09 Apr 2002 03:00:00 GMT  
 ListView Items - How to set colour ?
Hi Again,
Just after I sent the last message I reliased that I was using the VB5 control.
The VB6 control works a treat.
Thanks for your time, advice and patience.
Regards,
Rod.
Quote:

>Rod,
>What version on VB and what version of the CC Lib are you referencing?
>The code I shot out was yanked right out of a little sample I wrote
>recently.
>OK, I just loaded the CC 5SP2 and the thing does NOT have the property ;-(
>BUT the VB6 control does.  You might need to look around up at www.mvps.org
>look at /vbnet and /bmtz .  I know that one of those sites (maybe both) has
>the
>entire Listview API wrapped up (by Brad Martinez) .  Look through that stuff
>and see if you can get it to work.  Looks like the Common Controls are MUCH
>improved in VB6 (as far as the properties/ methods and events exposed!!)
>Neila


>>Hi Neila,
>>Your assistance is appreciated, however I get the message "Method or
>>data member not found" refering to .ListSubItems. Is it possible I
>>have the wrong control ?

>>If I key in :
>>ListView1.ListItems(1).  the drop down box does not show
>>.ListSubItems.

>>Any clues ?
>>Many thanks,
>>Rod.

>>On Thu, 30 Sep 1999 20:29:58 -0500, "Neila Nessa"

>>>In the VB6 control each ListItem.SubItem can be colored as you please..
>>>I don't remember about the VB5 control but don't think so without API
>calls
>>>(but I haven't looked at the VB5 Common Controls for awhile)..

>>>VB6 code...
>>>..........
>>>        With ListView1.ListItems.Item(lngIndex)
>>>            .ForeColor = vbRed
>>>            .Selected = blnState
>>>            .Checked = blnState
>>>            With .ListSubItems
>>>             .Item(1).Bold = True
>>>             .Item(2).Bold = True
>>>             .Item(1).ForeColor = vbRed
>>>             .Item(2).ForeColor = vbGreen
>>>        End With
>>>...........
>>>Neila
>>>-----


>>>>Hi,
>>>>I am writing a financial program which lists transactions in a
>>>>ListView. I would like cheques to be red, cash out to be black and
>>>>deposits to be green. I can use Icons, but the colour option is
>>>>prefered by the users.
>>>>Can anyone tell me if it is possible to set the colour of a listview
>>>>item individually ?
>>>>Any help appreciated.
>>>>Regards,
>>>>Rod.



Thu, 11 Apr 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. listview selected item colour

2. Listview item Text Colour

3. Setting Colour for ListBox Items

4. Listview Subitems - Setting Colour or Ghosting

5. Setting selected item in listview

6. Sorting ListView items & Setting ForeColor

7. Setting backcolor on LostFocus () for selected items in ListView

8. Set ListView Item Font As Italic

9. How to Programatically Set the ForeColor of ListView Items

10. How to set Listview Item

11. Setting Listview item programatically

12. jump listview to the hilight item (selected item)...

 

 
Powered by phpBB® Forum Software