[RESOLVED] SIMPLE: Indicate whether mouse left particular windows form control?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [RESOLVED] SIMPLE: Indicate whether mouse left particular windows form control?

  1. #1
    Join Date
    Jan 2010
    Posts
    130

    [RESOLVED] SIMPLE: Indicate whether mouse left particular windows form control?

    I'm sure I've done this before but I cant find any online resources on this topic to remind me...

    After the user has changed the text of textboxA and moved the mouse off that particular control, I would like my method to be executed. What bool expression determines whether the user's mouse has left the control?

    Code:
    if (!textboxA.Focused && textboxA.Text != String.Empty) // textboxA.Focused isnt working!
    {
            ExecuteMethod();
    }

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: SIMPLE: Indicate whether mouse left particular windows form control?

    Don't think like that. .NET uses an event driven model, so utilize the MouseLeave event. The Control.Focused property has nothing to do with the mouse.

  3. #3
    Join Date
    Jan 2010
    Posts
    130

    Re: SIMPLE: Indicate whether mouse left particular windows form control?

    thank you! I used "leave" instead of "mouseleave" which works even better

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center