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_ComboA = 500
%IDC_ComboB = 501
%IDC_ComboC = 502
Global hDlg As Dword
Function PBMain() As Long
Dim MyArray(3) As String
Array Assign MyArray() = "zero", "one", "two", "three"
Dialog New Pixels, 0, "ComboBox Test",300,300,200,200, %WS_OverlappedWindow, 0 To hDlg
Control Add ComboBox, hDlg, %IDC_ComboA, MyArray(), 20,10,75,100
Control Add ComboBox, hDlg, %IDC_ComboB, MyArray(), 20,50,75,100
Control Add ComboBox, hDlg, %IDC_ComboC, MyArray(), 20,90,75,100
ComboBox Select hDlg, %IDC_ComboA, 1
ComboBox Select hDlg, %IDC_ComboB, 2
ComboBox Select hDlg, %IDC_ComboC, 3
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local w,h As Long
Select Case Cb.Msg
Case %WM_InitDialog
Control Set Focus hDlg, %IDC_ComboC
Case %WM_NextDlgCtl
Dialog Set Text hDlg, Time$
Case %WM_Size
Dialog Get Client hDlg To w,h
Control Set Size hDlg, %IDC_ComboA, w-40,20
Control Set Size hDlg, %IDC_ComboB, w-40,20
Control Post hDlg, %IDC_ComboA, %CB_SetEditSel, 0, Mak(Long,-1,0)
Control Post hDlg, %IDC_ComboB, %CB_SetEditSel, 0, Mak(Long,-1,0)
End Select
End Function
'gbs_00776
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm