CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2002
    Posts
    49

    Dialog closes upon <CR>

    How do I get this to stop?

  2. #2
    Join Date
    Apr 2004
    Posts
    76
    Hi wbartley,

    In class wizard, override the OnOK click message. Do not call the base class.

    Jeff

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640
    Don't make your OK (or cancel) button the default button.

    In VS 7.1; open the dialog in the resource editor, and bring up the properties on the OK button. Make sure the "Default Button" property is "False". Do the same for the "Cancel" button (if you have one).

    Viggy

  4. #4
    Join Date
    Nov 2002
    Posts
    49
    I have no OK button (I deleted it when I created the dialog) and I can't find any OnOK method.

  5. #5
    Join Date
    Feb 2002
    Posts
    4,640
    Add it using the Class Wizard (or whatever they are calling it in VS 7.1; I forget).

    Vig.

  6. #6
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following FAQ...

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