Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with check box status.
#2
need to use DT_GetControls and v attribute onĀ #sub DlgProc

Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 180 60 "Dialog" "4"
;3 Button 0x54032000 0x0 8 36 48 14 "Button"
;4 Button 0x54012003 0x0 8 16 48 10 "Check"
;1 Button 0x54030001 0x4 64 36 48 14 "OK"
;2 Button 0x54030000 0x4 120 36 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

str controls = "4"
str c4Che
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,DT_GetControls hDlg
,int cChecked=val(c4Che); out "Check: %s" iif(cChecked "checked" "unchecked")
,out cChecked
ret 1

can also do this

Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 180 60 "Dialog" "4"
;3 Button 0x54032000 0x0 8 36 48 14 "Button"
;4 Button 0x54012003 0x0 8 16 48 10 "Check"
;1 Button 0x54030001 0x4 64 36 48 14 "OK"
;2 Button 0x54030000 0x4 120 36 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

str controls = "4"
str c4Che
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 IDOK
,case IDCANCEL
,case 3
,int cChecked=but(id(4 hDlg)); out "Check: %s" iif(cChecked "checked" "unchecked")
,out cChecked
ret 1


Messages In This Thread
Problem with check box status. - by TNH - 02-18-2021, 02:41 AM
RE: Problem with check box status. - by Kevin - 02-18-2021, 02:54 AM
RE: Problem with check box status. - by TNH - 02-18-2021, 03:05 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)