CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Posts
    75

    How to disable default push button message handling

    Hi all,

    I have several edit controls and buttons on an edit control. When a number is entered and the user press enter i would like that nothing would happen.
    So i would like to disable the default push button control handling. How could i do this? I found only how to do it for MFC.

    Thanks.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: How to disable default push button message handling

    Subclass the edit control and handle WM_GETDLGCODE message in its window procedure.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How to disable default push button message handling

    So i would like to disable the default push button control handling.
    Well, did you try to unset default attribute for the button?
    Best regards,
    Igor

  4. #4
    Join Date
    Jul 2006
    Posts
    75

    Re: How to disable default push button message handling

    Quote Originally Posted by Igor Vartanov View Post
    Well, did you try to unset default attribute for the button?
    No. I wasn't aware about this option. That worked. Thanks.

    PS: I found alternative way to do:
    SendMessage(hwndDlg,DM_SETDEFID,IDOK,0);
    and to ensure that there is no IDOK control in the dialog box.

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