Background color Listview gadget

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cor.

How to change background color of ListViewgadget?

Using Windows 98 SE
Registered PB version : 2.90 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Insert this within your OpenWindow() part:

Code: Select all

  ListIconGadget = ListIconGadget(0, 0, 0, LVWidth, WindowHeight()-30, "This", LVWidth/4-1)
  AddGadgetColumn(0, 1, "is", LVWidth/4-1)
  AddGadgetColumn(0, 2, "a", LVWidth/4-1)
  AddGadgetColumn(0, 3, "test", LVWidth/4-1)

  SendMessage_(ListIconGadget, #LVM_SETBKCOLOR, 0, RGB(128, 128, 128)) ; change blank cells background color
  SendMessage_(ListIconGadget, #LVM_SETTEXTBKCOLOR, 0, RGB(216, 64, 216)) ; change cells background color
  SendMessage_(ListIconGadget, #LVM_SETTEXTCOLOR, 0, RGB(0, 32, 128)) ; change text color

  AddListIconGadgetItem(0, 0, "Column 1"+Chr(10)+"Column 2"+Chr(10)+"Column 3"+Chr(10)+"Column 4", 0)
There is a GET version for those SendMessage_(). Bye,



El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

What's the RGB procedure code?


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Guess you're joking, but just in case you're not, RGB() isn't a procedure, is a PureBasic function that translates red, green and blue values to Windows COLORREF format to use with functions.

Code: Select all

RGB(red.b, green.b, blue.b)
(You were joking, right?)

Sleep well,

El_Choni

PS: you were right, it can be a procedure:

Code: Select all

Procedure.l RGB(red.b, green.b, blue.b)
  colorref.l = red + (green*256) + (blue*65536)
  ProcedureReturn colorref
EndProcedure
Edited by - El_Choni on 04 February 2002 23:58:43
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Actually RGB() is not a native command to PureBasic. It is found in the ASM SkinWin library by Danilo, found on the PB Resources Site.



Edited by - paul on 05 February 2002 01:48:45
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Ok, sorry, PB, then. You know, Danilo's library is a must! :wink:

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Ok, sorry, PB, then. You know, Danilo's library is a must! :wink:

Hehehe, no worries.


PB - Registered PureBasic Coder
Post Reply