Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
%IDC_Plain = 500 : %IDC_ListBox = 503
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "ListBox Test",300,300,200,200, %WS_OverlappedWindow, 0 To hDlg
Control Add Button, hDlg, %IDC_Plain, "Plain", 10,10,50,20
Control Add ListBox, hDlg, %IDC_ListBox, , 10,40,180,150
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local i As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Plain
SendMessage GetDlgItem(hDlg,%IDC_ListBox), %WM_SetRedraw, %False, 0
ListBox Reset hDlg, %IDC_ListBox
For i = 1 To 100000
ListBox Add hDlg, %IDC_ListBox, Str$(i)
Next i
SendMessage GetDlgItem(hDlg,%IDC_ListBox), %WM_SetRedraw, %True, 0
? "plain done"
End Select
End Select
End Function
'gbs_00797
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm