How not to close the Dialog Box
-
Hi, Help me please with the following: I created an application, and added a dialog box to that, and, in the dialog box there are edit boxes, and I can't manage the following: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box? Thanx.
-
Hi, Help me please with the following: I created an application, and added a dialog box to that, and, in the dialog box there are edit boxes, and I can't manage the following: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box? Thanx.
Are you using a class library? If you're using MFC (just guessing), you do your checks in
OnOK()
. If the data doesn't pass your checks, just don't callCDialog::OnOK()
--Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER -
Are you using a class library? If you're using MFC (just guessing), you do your checks in
OnOK()
. If the data doesn't pass your checks, just don't callCDialog::OnOK()
--Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER -
Are you using a class library? If you're using MFC (just guessing), you do your checks in
OnOK()
. If the data doesn't pass your checks, just don't callCDialog::OnOK()
--Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER -
Oh, one more thing how that is done with tabbed dialog boxes? I did that in single dialog box, works fine, but in the tabbed dialog boxes i cant manage. thanx.
Override OnQueryCancel() in your property page --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER
-
Override OnQueryCancel() in your property page --Mike-- Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--= NO CARRIER
well, for Cancel button I need nothing, what I need is when the OK button pressed, to check if the Edit Box is Empty, if it is empty, not closing the dialog (Tabbed) Box, go set the Focus to that Edit Box. I managed to check the Edit, but the Dialog (tabbed) Box closes. I do not press te Cancel Button.
-
Hi, Help me please with the following: I created an application, and added a dialog box to that, and, in the dialog box there are edit boxes, and I can't manage the following: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box? Thanx.
Exceter wrote: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box? Do not allow the OK button to be clicked until ALL controls contain valid data. Your users will be very annoyed that the OK button is allowed to be clicked when there is invalid data; this violates the basic principles of GUI design.
-
well, for Cancel button I need nothing, what I need is when the OK button pressed, to check if the Edit Box is Empty, if it is empty, not closing the dialog (Tabbed) Box, go set the Focus to that Edit Box. I managed to check the Edit, but the Dialog (tabbed) Box closes. I do not press te Cancel Button.
You need to do validation in the page's
OnKillActive()
function. ReturningFALSE
will keep the user from switching to the other tab(s). Also, When the OK button is clicked,OnKillActive()
is called first to see if it is ok to proceed. Set breakpoints in these two methods to see how things work. -
Exceter wrote: when I press the OK Button I want to check if there are any empty edit boxes, and if there are, not to closing the dialog box go to that edit box? Do not allow the OK button to be clicked until ALL controls contain valid data. Your users will be very annoyed that the OK button is allowed to be clicked when there is invalid data; this violates the basic principles of GUI design.
-
It was not meant to be "disallowed." See my reply about
OnKillActive()
.