Loading event code manually

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VM

    #1

    Loading event code manually

    How can I manually run the code of an event? For example, I want to run a
    Mouse click event without actually clicking doing a Mouse click?
    Thanks.


  • Jeffrey Tan[MSFT]

    #2
    RE: Loading event code manually


    Hi VM,
    In the InitializeCompo nent() method, you can see the control's
    event is bind to a method.(by delegate)
    You can directly invoke the method to trigger this event.

    For example, if you want to trigger the Form_Load event, in Button_click
    event, you can invoke like this:

    this.Form1_Load (sender,e);

    HTH.

    Jeffrey Tan
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.

    --------------------
    | From: "VM" <None>
    | Subject: Loading event code manually
    | Date: Fri, 15 Aug 2003 17:09:28 -0500
    | Lines: 5
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    | Message-ID: <uuZuE7$YDHA.20 24@TK2MSFTNGP12 .phx.gbl>
    | Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
    | NNTP-Posting-Host: 66-50-71-98.prtc.net 66.50.71.98
    | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
    | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1768 83
    | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
    |
    | How can I manually run the code of an event? For example, I want to run a
    | Mouse click event without actually clicking doing a Mouse click?
    | Thanks.
    |
    |
    |

    Comment

    Working...