CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Setfocus() mfc

  1. #1
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    201

    Question Setfocus() mfc

    Hello,

    using:

    pWnd = CWnd::FindWindow(NULL, L"DIALOG TITLE");
    to find a particular dialog.

    after that,
    I want to set the focus to an Edit Control which has ID 1304.

    How do I declare this?

    regards,

    ger

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Setfocus() mfc

    Have a look at CWnd::GetDlgItem
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    201

    Re: Setfocus() mfc

    Hi Victor,

    thanks for the reply!

    I allready had a look at CWnd::GetDlgItem
    having troubles to implement it correctly.
    in concert with SetFocus().

    regards,

    ger
    (holland)

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Setfocus() mfc

    Quote Originally Posted by TBBW View Post
    Hi Victor,

    thanks for the reply!

    I allready had a look at CWnd::GetDlgItem
    having troubles to implement it correctly.
    in concert with SetFocus().

    regards,

    ger
    (holland)
    pWnd->GetDlgItem(1304)->SetFocus();

  5. #5
    Join Date
    Oct 2009
    Location
    Holland
    Posts
    201

    Re: Setfocus() mfc

    the one I did not checked..........

    THANKS!!

    ger

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