Edit control focus locks application
-
:confused:Hi, I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence. Buck
-
:confused:Hi, I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence. Buck
BuckBrown wrote:
I want the dialog box to come up with the cursor in the edit box ready for input.
The first control on the dialog that has an id other than
IDC_STATIC
will automatically get the initial focus. Otherwise, you'll need to callSetFocus()
. If you opt for this, be sure and returnFALSE
fromOnInitDialog()
.
"Take only what you need and leave the land as you found it." - Native American Proverb
-
:confused:Hi, I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence. Buck
-
:confused:Hi, I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence. Buck
-
:confused:Hi, I have a simple dialog box that has an edit control. I want the dialog box to come up with the cursor in the edit box ready for input. I can do this using myDialog::UpdateDialogControls(pWndCtrl, TRUE) but then the focus is locked on the edit control and I can't use the OK or CANCEL buttons and I have to use the task manager to end the application. I have also tried the GotoCtrl(pWndCtrl) with UpdateData() and UpdateWindow() and some other variations that seemed like they might work but they have no effect at all. This is probably very simple, I just can't seem to figure out the right command sequence. Buck