PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: FF3 - ListView Text And Text Background Colouring  (Read 253 times)

SeaVipe

  • Junior Member
  • **
  • Posts: 194
  • Windows 10
FF3 - ListView Text And Text Background Colouring
« 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:


Code: [Select]

    '' 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.
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

Josť Roca

  • Guru Member
  • *****
  • Posts: 3208
Re: FF3 - ListView Text And Text Background Colouring
« Reply #1 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.

SeaVipe

  • Junior Member
  • **
  • Posts: 194
  • Windows 10
Re: FF3 - ListView Text And Text Background Colouring
« Reply #2 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!
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

David Kenny

  • Senior Member
  • ***
  • Posts: 457
  • Windows 7 & 10
Re: FF3 - ListView Text And Text Background Colouring
« Reply #3 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
Link in the top post.


David
Logged

SeaVipe

  • Junior Member
  • **
  • Posts: 194
  • Windows 10
Re: FF3 - ListView Text And Text Background Colouring
« Reply #4 on: July 16, 2019, 03:05:40 PM »

Thank you, David, Jean-Pierre's code works great; just what I was looking for!


Clive
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill