Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save Button
#1
I have a smart dialog that i have made.
There is a save button on it and a Start Function that will run a selected macro.
What i want to do is make the start button (Id "21") Inoperble if i change text (passowrd field) in ids 23,17,and 18. I was just wondering if the text is changed from the inital startup of the dialog the start button wont work until you hit save settings. And if start button is hit before saving settings it will thow a message error. Just wondering if this is at all possible
#2
in dialog editor set WS_DISABLED style for the button. When Save button clicked, enable it using EnableWindow function.
#3
Gintaras Wrote:in dialog editor set WS_DISABLED style for the button. When Save button clicked, enable it using EnableWindow function.
sorry a little confused on how to do that :? i have 4 password fields and i just want to make it if any of the password fields are changed or edited after opening the dialog you have to save your settings before you can hit the button (start)
#4
?
#5
Function Dialog14
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3 4 5 6"
str e3 e4 e5 e6
e3="aaa"
if(!ShowDialog("Dialog14" &Dialog14 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;3 Edit 0x54030080 0x200 16 6 96 14 ""
;4 Edit 0x54030080 0x200 16 22 96 14 ""
;5 Edit 0x54030080 0x200 16 38 96 14 ""
;6 Edit 0x54030080 0x200 16 54 96 14 ""
;7 Button 0x5C032000 0x0 16 82 48 14 "Save"
;8 Button 0x54032000 0x0 66 82 48 14 "Start"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case [EN_CHANGE<<16|3,EN_CHANGE<<16|4,EN_CHANGE<<16|5,EN_CHANGE<<16|6] ;;text changed in one of controls 3-6
,EnableWindow id(7 hDlg) 1 ;;enable Save
,
,case 8 ;;Start
,if(IsWindowEnabled(id(7 hDlg))) mes "please save" "" "!"; ret
,mes "started" "" "i"
,
,case 7 ;;Save
,MES m.timeout=1; mes "saving..." "" m
,EnableWindow id(7 hDlg) 0 ;;disable Save
,
,case IDOK
,case IDCANCEL
ret 1
#6
thank you very much


Forum Jump:


Users browsing this thread: 1 Guest(s)