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

Thread: CEdit subclass

  1. #1
    Join Date
    Apr 1999
    Posts
    6

    CEdit subclass

    By default, clicking the OK button on a CDialog with the mouse is equivalent to pressing the ENTER key when the OK button is highlighted. In other words, both events trigger CDialog::OnOK(). I have a subclassed CEdit control (CNumEdit described on this web site) which behaves differently depending on whether CDialog::OnOK is tiggered by a mouse click on the OK button, or by pressing the OK button. In the former case, the edit value is retrieved from the control, and in the latter case, the edit value is not retrieved. I thought of adding an OnKeyUp() handler in the subclassed CNumEdit class to detect the ENTER key activity, and then retrieve the edit value from the control, but this seems like a kludge. Does anyone have a suggestion on how best to retrieve edit values from a subclassed control using exisiting CDialog data exchange functionality??


  2. #2
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: CEdit subclass

    How you reach OnOK() shouldn't really matter... I'd look at the examples on my web site which deal with subclassing CEdit and see how they're done... You shouldn't have to do anything special.

    Check out Examples 5 and 14 at http://home.earthlink.net/~railro/mfc_link.html.

    Rail

    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    [email protected]
    http://home.earthlink.net/~railro/

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