Results 1 to 3 of 3

Thread: Event Handling [Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251

    Event Handling [Resolved]

    I have created a usercontrol with my own events. Everything works great, except if I trigger an event that I am not using in the parent form. If the parent form does not have the event implemented an exception error is generated.


    Is there any way around this as I do not need to implement all the events in all the forms in which it is used.
    Last edited by BryanJ; Aug 6th, 2003 at 06:45 PM.
    Control Data Systems
    www.members.shaw.ca/cdsystems

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Before you call the event, check it to see if anyone has subscribed:

    if(MyEvent != null)
    {
    MyEvent(arguments);
    }

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2000
    Location
    San Diego - California
    Posts
    251
    Thanks Hellswraith,

    That is exactely what I wanted.

    Thanks once again.
    Control Data Systems
    www.members.shaw.ca/cdsystems

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