Suppressing Next button on wizard
-
I hope I can explain this without too much confusion. Let's say you have an edit box in a wizard. You enter data outside the valid range. If you click Enter instead of Tab, you get an error message. If you click on Enter to dismiss the error, it acts like an Enter and goes onto the Next screen. The original code looked like this: // Check the validity of the value l_lVal = atof((_bstr_t)InBurstLengthStr); if((l_lVal > m_dMaxBurstLength) || (l_lVal < m_dMinBurstLength)) { // If the entered value is out of range then throw an error ::MessageBox(m_hWnd, L"The Burst Length Entered is not Within the Specified Range!", L"Data Entry Error",MB_OK | MB_ICONEXCLAMATION); BurstLengthEdit.SetFocus(); return 0; } I changed it so that I got the click. I checked if the click was IDOK, called the setfocus, but that didn't help. I saw where someone else made the enter key act like a tab key if they were in an edit field with a hook. I couldn't get that to work. It just wanted to act like a Next, which was weird because it didn't appear to be the default button. Please HELP me if you can! Thanks, Lilian
-
I hope I can explain this without too much confusion. Let's say you have an edit box in a wizard. You enter data outside the valid range. If you click Enter instead of Tab, you get an error message. If you click on Enter to dismiss the error, it acts like an Enter and goes onto the Next screen. The original code looked like this: // Check the validity of the value l_lVal = atof((_bstr_t)InBurstLengthStr); if((l_lVal > m_dMaxBurstLength) || (l_lVal < m_dMinBurstLength)) { // If the entered value is out of range then throw an error ::MessageBox(m_hWnd, L"The Burst Length Entered is not Within the Specified Range!", L"Data Entry Error",MB_OK | MB_ICONEXCLAMATION); BurstLengthEdit.SetFocus(); return 0; } I changed it so that I got the click. I checked if the click was IDOK, called the setfocus, but that didn't help. I saw where someone else made the enter key act like a tab key if they were in an edit field with a hook. I couldn't get that to work. It just wanted to act like a Next, which was weird because it didn't appear to be the default button. Please HELP me if you can! Thanks, Lilian
The code you've posted is located in some event handler; you didn't include the function header. Which event is it? Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
-
The code you've posted is located in some event handler; you didn't include the function header. Which event is it? Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
The method name is OnKillFocusBurstLengthEdit, EN_SETFOCUS.
-
The method name is OnKillFocusBurstLengthEdit, EN_SETFOCUS.
EN_KILLFOCUS handler doesn't give you any control over page navigation. I *guess* (never did that personally) you should check values in OnWizardNext and return -1 if they don't satisfy your conditions. Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
-
EN_KILLFOCUS handler doesn't give you any control over page navigation. I *guess* (never did that personally) you should check values in OnWizardNext and return -1 if they don't satisfy your conditions. Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
Thanks, I knew this was something beyond my control/comprehension!