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_ComboBox = 601
Global hDlg, hCombo, hComboEdit As Dword
Function PBMain() As Long
Dim MyArray(3) As String
Array Assign MyArray() = "zero", "one", "two", "three"
Dialog New Pixels, 0, "ComboBox Context Menu",300,300,200,100, %WS_SysMenu, 0 To hDlg
Control Add ComboBox, hDlg, %IDC_ComboBox, MyArray(), 10,20,150,100,
Control Handle hDlg, %IDC_ComboBox To hCombo
ComboBox Select hDlg, %IDC_ComboBox, 1
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local ComboInfo As ComboBoxInfo
Select Case Cb.Msg
Case %WM_InitDialog
ComboInfo.cbSize = SizeOf(ComboBoxInfo)
GetComboBoxInfo(hCombo, ByVal VarPtr(ComboInfo)) 'get data about combobox
hComboEdit = ComboInfo.hwndItem 'handle to edit control of combobox
Case %WM_CtlColorEdit
If Cb.LParam = hComboEdit Then
SetBkColor Cb.WParam, %rgb_LightBlue
Function = 1
End If
End Select
End Function
'gbs_00782
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm