how to enable the "ok" button after 8 second in MFC Dialog box
-
in my project, when the dialog box (window) is initialized( i,e Onintdialog())the "ok" button is disabled, and i want it to enable automatically after 8 seconds. plz can any one guide me to enable the button after 8 seconds...
-
in my project, when the dialog box (window) is initialized( i,e Onintdialog())the "ok" button is disabled, and i want it to enable automatically after 8 seconds. plz can any one guide me to enable the button after 8 seconds...
Create a timer in the
OnInitDialog()
handler. In theOnTimer()
handler, enable the OK button and kill the timer. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com -
in my project, when the dialog box (window) is initialized( i,e Onintdialog())the "ok" button is disabled, and i want it to enable automatically after 8 seconds. plz can any one guide me to enable the button after 8 seconds...
OnInitDialog() :
((CButton*)GetDlgItem(IDOK))->EnableWindow(FALSE);
SetTimer(100 /* ID=100, for example */, 8000 /* in milliseconds */, NULL /* callback function */);
//...OnTimer(UINT nIDEvent) :
if (nIDEvent == 100) {
((CButton*)GetDlgItem(IDOK))->EnableWindow(TRUE);
KillTimer(100);
}
TOXCCT >>> GEII power