Code: Select all
EnableExplicit
Enumeration
#MyWin
#MyList
#Font12
#Font16
EndEnumeration
LoadFont(#Font12, "Arial", 12, #PB_Font_HighQuality)
LoadFont(#Font16, "Arial", 16, #PB_Font_Bold)
Procedure MyWindow()
;#------------------
Protected iRow.i
Protected iFlags.i = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
If OpenWindow(#MyWin, 0, 0, 420, 220, "ListIcon Font", iFlags)
ListIconGadget(#MyList, 10, 10, 400, 200, "Col 0", 100, #PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetColumn(#MyList, 1, "Col 1", 100)
AddGadgetColumn(#MyList, 2, "Col 2", 100)
AddGadgetColumn(#MyList, 3, "Col 3", 100)
For iRow = 0 To 10
AddGadgetItem(#MyList, iRow, "Col 0" + #LF$ + "Col 1" + #LF$ + "Col 2" + #LF$ + "Col 3")
Next
SetGadgetItemColor(#MyList, #PB_All, #PB_Gadget_FrontColor, RGB(0,0,255))
SetGadgetFont(#MyList, FontID(#Font12))
SendMessage_(SendMessage_(GadgetID(#MyList), #LVM_GETHEADER, 0, 0), #WM_SETFONT, FontID(#Font16), 1)
SendMessage_(SendMessage_(GadgetID(#MyList), #LVM_GETHEADER, 0, 0), #LVM_SETTEXTCOLOR, RGB(255, 0, 0), 1) ;<-- fail!
EndIf
EndProcedure
Procedure WaitForUser()
;#---------------------
Protected iExit.i = #False
Repeat
Select WaitWindowEvent(1)
Case #PB_Event_CloseWindow: iExit = #True
EndSelect
Until iExit = #True
EndProcedure
MyWindow()
WaitForUser()
End
sRod posted code years ago that can change header backcolour and font colour, but:
1) Huge amount of code
2) Turns nice Win7 Headers into ugly classic headers
http://www.purebasic.fr/english/viewtopic.php?t=27488
So, has anyone got a magic wand solution for this?