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
			
			
									
									
						Background color Listview gadget
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by El_Choni.
Insert this within your OpenWindow() part:
There is a GET version for those SendMessage_(). Bye,
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)
El_Choni
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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.
(You were joking, right?)
Sleep well,
El_Choni
PS: you were right, it can be a procedure:
Edited by - El_Choni on 04 February 2002  23:58:43
			
			
									
									
						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)
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
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
- 
				BackupUser
- PureBasic Guru 
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
