CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    121

    SetFocus() not working!!!

    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
    }




  2. #2
    Join Date
    May 1999
    Posts
    26

    Re: SetFocus() not working!!!


    You should return FALSE from the function!!

    (Read the comments!!)

    Santhosh



  3. #3
    Join Date
    Apr 1999
    Posts
    121

    Re: SetFocus() not working!!!

    Thanks

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




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured