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"
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_SysMenu, 0 To hDlg
Control Add ComboBox, hDlg, 100, MyArray(), 50,50,75,100
ComboBox Select hDlg, 100, 1
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command And Cb.Ctl = 100 And Cb.CtlMsg = %CBN_SelChange Then
HideComboSel GetDlgItem(hDlg, 100)
End If
End Function
Sub HideComboSel(hCombo As Dword)
Local p As ComboboxInfo, hEdit As Dword
p.cbsize = SizeOf(p)
GetComboBoxInfo hCombo, p
hEdit = p.hwndItem
PostMessage hEdit,%EM_SetSel, 0, 0 'Mak(Long,-1,0)
End Sub
'gbs_00777
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm