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

    Disable mosue movement when user entering data in an edit box

    Hi All,

    I want to disable the mosue movement in a MFC view application if the control is in an edit box and user entering data in the edit box. I want to get back the mouse movement once user presses enter key in the edit box, can anybody tell me how can I do this in MFC view application

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

    Re: Disable mosue movement when user entering data in an edit box

    Why?

  3. #3
    Join Date
    Oct 2005
    Location
    Minnesota, U.S.A.
    Posts
    680

    Re: Disable mosue movement when user entering data in an edit box

    I assume this is for some sort of public console. I think it would be better if you left the mouse alone and did a normal dialog type operation - disable the other windows and then reenable them after you are done with the edit control.

    Add in preventing KillFocus so the user cannot exit the edit control until CR is hit and you are all set.

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Disable mosue movement when user entering data in an edit box

    Use SetCapture so the edit box gets all the mouseclicks (which you need to ignore) , and use SetCursor to set the mousecursor to none (no image). The user doesn't see the cursor (although it is there), and all the clicks are rerouted to your editbox (where you ignore the clicks)... effectively the user can't use the mouse . Use ReleaseCapture to 'free' the mouseclicks and give the mousecursor a image again, so the user can use the mouse again.

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