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

    Getting Mouse Position when over a Pushbutton

    I have a dialog application. OnMouseMove is called anytime the mouse is within the dialog (client area). However, there is no mouse position when my cursor is over a pushbutton. I want something to happen when the cursor is over the pushbutton. The cursor position is present throughout the dialog box but it seems that OnMouseMove is not active while over a control in the dialog box. Any suggestions on how to know if the mouse is over a control? An example of waht I am referring to is tooltip. The tooltip get displayed when the cursor is over a control for a ceertain amount of time. I want something to happen immediately when a cursor is over a pushbutton. How do I detect this? Thank you.






  2. #2
    Join Date
    May 1999
    Posts
    17

    Re: Getting Mouse Position when over a Pushbutton

    One way would be to create your own class derived from CButton, include it as a member variable of your dialog class and override OnMouseMove() in your derived button class.

    Wizards will do all of this for you!

    Howard


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