Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode=1
#Include "win32api.inc"
Global hDlg As Dword 'main dialog handle
Function PBMain() As Long
Local i As Long
Dialog New Pixels, 0, "ListView Test",300,300,200,200,%WS_OverlappedWindow To hDlg
Control Add ListView, hDlg, 100, "", 10,10,280,180
ListView Insert Column hDlg, 100, 1, "test1", 90, 0
For i = 0 To 10 : ListView Insert Item hDlg, 100, i, 0, Str$(i) : Next i
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_InitDialog
SetTimer(hDlg, 500, 3000&, %NULL) 'sends %WM_Timer to dialog callback
'ListView Select hDlg, 100, 3
'ListView_SetItemState GetDlgItem(hDlg, 100), 2, %LVIS_Focused, %LVIS_Focused '<--- synchronizing code
Control Set Focus hDlg, 100
End Select
End Function
' ListView_SetItemState GetDlgItem(hDlg, 100), 2, %LVIS_Focused or %LVIS_Selected, %LVIS_Focused or %LVIS_Selected '<--- synchronizing code
'gbs_01249
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm