in the WindowCallback (see an example by Danilo from the code archiv).
Worked pretty well so far, but when i added a Splittergadget() that was
put other my ListView it didn't color right any more.
Code: Select all
ColorBrush = CreateSolidBrush_(RGB($00, $00, $00)) ; BACKGROUND
Procedure WindowCallBack(hwnd, msg, wParam, lParam)
Shared ColorBrush
Result = #PB_ProcessPureBasicEvents
If msg = #WM_CTLCOLORLISTBOX
SetTextColor_(wParam, RGB(0, 0, 200)) ; FOREGROUND
SetBkMode_(wParam, #TRANSPARENT)
Result = ColorBrush
EndIf
ProcedureReturn Result
EndProcedure
If OpenWindow(0, 205, 186, 775, 569, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered, "Test")
If CreateGadgetList(WindowID())
SetWindowCallback(@WindowCallBack())
ListViewGadget(0, 660, 165, 110, 285)
For i = 1 To 4
AddGadgetItem(0, -1, Str(i))
Next i
EditorGadget(1, 5, 165, 650, 285)
;/comment the splittergadget out to see the effect without problems :/
SplitterGadget(2, 5, 165, 765, 285, 1, 0, #PB_Splitter_Vertical | #PB_Splitter_SecondFixed)
EndIf
EndIf
Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
DeleteObject_(ColorBrush)
End
bad case. . .
Any ideas? Another way of coloring, of handling the callback, the
SplitterGadget or something?
Thanks a lot!

