Click to See Complete Forum and Search --> : SetFocus() not working!!!


Sophie
May 14th, 1999, 10:34 AM
Can someone tell me why this code will not put focus on my IDC_PASSWORD

Thank you

BOOL DlgVerifyPassword::OnInitDialog()
{
CDialog::OnInitDialog();

CWnd *pWnd = GetDlgItem(IDC_PASSWORD);
pWnd->SetFocus();

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

scp
May 14th, 1999, 11:02 AM
You should return FALSE from the function!!

(Read the comments!!)

Santhosh

Sophie
May 14th, 1999, 11:13 AM
Thanks

Yes I read the comment after I sent the posting. Sorry for wasting your time!