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
Dialog New Pixels, 0, "ListView Test",300,300,200,140,%WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 200, "Push",10,10,100,20
Control Add ListView, hDlg, 100, "", 10,40,180,80
ListView Insert Column hDlg, 100, 1, "test1", 90, 0
ListView Insert Column hDlg, 100, 2, "test2", 90, 0
ListView Insert Item hDlg, 100, 1, 0, "one" 'row,image
ListView Insert Item hDlg, 100, 2, 0, "two" 'row,image
ListView Insert Item hDlg, 100, 3, 0, "three" 'row,image
ListView Set Text hDlg, 100, 1,2, "12" 'row1 col2
ListView Set Text hDlg, 100, 2,2, "22" 'row2 col2
ListView Set Text hDlg, 100, 3,2, "33" 'row2 col2
ListView Set StyleXX hDlg, 100, %LVS_Ex_GridLines Or %LVS_Ex_FullRowSelect
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case 200
If Cb.CtlMsg = %BN_Clicked Then ? "Button pressed"
End Select
Case %WM_Notify
Select Case Cb.NmId
Case 100
If Cb.NmCode = %LVN_ColumnClick Then ? "Column clicked"
End Select
End Select
End Function
'gbs_01238
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm