Leave event in a very simple user control ... 
Author Message
 Leave event in a very simple user control ...

Hello Paolo,

You may handle the Leave event of the MyNumeric Control instead of the
TextBox. The Leave event only occurs when you switch focus between the
controls in a same container. Since the TextBox fill full of your control,
when you leave the focus from the TextBox the control also lose the focus.
Hence the Leave event will not occur. You may try this code:

this.Leave += new System.EventHandler(this.MyNumeric_Leave);

private void MyNumeric_Leave(object sender, System.EventArgs e)


I hope this is helpful.

Best regards,

Lion Shi, MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2001 Microsoft Corporation. All rights

    Subject: Leave event in a very simple user control ...
    Date: Tue, 14 May 2002 15:08:48 +0200
    Lines: 177
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

    Newsgroups: microsoft.public.dotnet.languages.CSharp
    Path: cpmsftngxa08!tkmsftngp01!tkmsftngp02
    Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:60669
    X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

    Hi, in a very simple user control (only one tbox) I can raise the
    textbox1_enter event but not the textbox1_leave event. Why ?
    Thank. Paolo

Sun, 31 Oct 2004 22:32:55 GMT  
 Leave event in a very simple user control ...
Thank. Paolo

Sun, 31 Oct 2004 22:40:38 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Subscribing to a Web User Control Event

2. Events in User Controls

3. Horrible user control bug stripped all user controls from my project

4. Distinguishing User Interface events: user -vs- programatic

5. Setting focus back to self in a custom Windows User Control from within the "Leave" focus event

6. Create Comboxbox where users left clicks ?

7. Detect left vs. right click event

8. CListCtrl left mouse click event handler

9. Enter/Leave CView events?

10. Left mouse button event in CDragListBox

11. C# Focus Issues - Touch Screen - User Controls - Button Control - TextBox

12. WebBrowser control - create my own user control


Powered by phpBB® Forum Software