Fire an event

This is a discussion on Fire an event within the C# Programming forums, part of the General Programming Boards category; Hi So I have an event handler for a button like so Code: private void button1_Click(object sender, System.EventArgs e) { ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    591

    Fire an event

    Hi

    So I have an event handler for a button like so
    Code:
    private void button1_Click(object sender, System.EventArgs e)
    {
        //DoCoolStuff
    }
    How can I fire this button event from another function in my program?

    ~Barjor

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,138
    If you have the button variable, you can call button.Click, or you can call the event handler function manually.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 02:27 AM
  2. Event driven thread programming
    By jaxen in forum C++ Programming
    Replies: 6
    Last Post: 11-22-2006, 07:46 AM
  3. forest fire
    By Kohatian 3279 in forum C++ Programming
    Replies: 0
    Last Post: 04-18-2002, 01:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21