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"
Enum Equates Singular
IDC_ListBox
End Enum
Global hDlg As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "PowerBASIC",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add ListBox, hDlg, %IDC_ListBox,, 10,10,180,180, %WS_HScroll Or %LBS_Sort Or %LBS_Notify Or %WS_TabStop Or %WS_VScroll Or %LBS_UseTabStops, %WS_Ex_ClientEdge
Control Send hDlg, %IDC_ListBox, %LB_SetHorizontalExtent, 1000, 0
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_InitDialog
Local temp$
Open "mytextfile.txt" For Input As #1
While IsFalse(Eof(1))
Line Input #1, temp$
ListBox Insert hDlg, %IDC_ListBox, 1, temp$ + " filler to make the line biggers so HScrollbar shows"
Wend
Close #1
End Select
End Function
'gbs_01391
'Date: 10-17-2014
http://www.garybeene.com/sw/gbsnippets.htm