Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combo selection from menu
#1
In a menu, among other choices, I want to select an item from a combo box. I wrote the code attached. I wonder whether there exists any other more elegant technique. Any advice will be much appreciated. Thanks in advance.

Menu Menu34_Combo
Code:
Copy      Help
Line 1 :mes "Line1" *
Combo :mac "Dialog34_Combo" *

Function Dialog34_Combo
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90000AC8 0x0 0 0 58 14 "Dialog"
;3 ComboBox 0x54230243 0x0 6 1 49 212 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

str controls = "3"
str cb3
cb3=
;1991
;1992
;1993
;1994
;1995

if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,
,case [CBN_SELCHANGE<<16|3]
,,CB_SelectedItem(id(3 hDlg) _s)
,,_s.setclip
,,DT_Ok hDlg
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)