PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: SeaVipe on July 15, 2019, 07:56:39 PM

Title: FF3 - ListView Text And Text Background Colouring
Post by: SeaVipe on July 15, 2019, 07:56:39 PM
Does anyone know if a ListView control can have different coloured Text And Text Background based on Items?
The 3 below work properly but they set colours for the entire ListView control not individual Items like Rows or Cells:




    '' Text
    ListView_SetTextColor(HWND_FORM1_LISTVIEW1, CLR_NONE) ' Windows text colour.
    '' Grid
    ListView_SetTextBkColor(HWND_FORM1_LISTVIEW1, &HBCB772 )
    '' The BackGround, behind everything
    ListView_SetBkColor(HWND_FORM1_LISTVIEW1, &HD25FDC)





I've been on the Microsoft site looking into all the various ListView API commands but nothing looks as though it will do what I want.
(If not then I'll dig a bit deeper into James Klutho's GRD (very nice) which I've yet to figure out how to get onto a FF3 or WinFBE form.)


Thanks.
Title: Re: FF3 - ListView Text And Text Background Colouring
Post by: José Roca on July 15, 2019, 08:17:28 PM
No. Windows controls do what they do and, when you want something different, you have to make them owenerdraw and paint them by yourself.
Title: Re: FF3 - ListView Text And Text Background Colouring
Post by: SeaVipe on July 15, 2019, 08:27:50 PM
Thanks José, I had a feeling that was going to be the answer. Time for a little research!
Title: Re: FF3 - ListView Text And Text Background Colouring
Post by: David Kenny on July 16, 2019, 06:54:39 AM
SeaVipe,

This might speed up your research.  Example code by Jean-pierre Leroy: https://www.planetsquires.com/protect/forum/index.php?topic=2026.msg16333#msg16333 (https://www.planetsquires.com/protect/forum/index.php?topic=2026.msg16333#msg16333)
Link in the top post.


David
Title: Re: FF3 - ListView Text And Text Background Colouring
Post by: SeaVipe on July 16, 2019, 03:05:40 PM
Thank you, David, Jean-Pierre's code works great; just what I was looking for!


Clive