Results 1 to 5 of 5

Thread: Raiseevent in class from a form?

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    Raiseevent in class from a form?

    Is it possible to raise andevent of a class from a form in the same project?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You could make a sub that triggers the event as part of the object. Like obj.Notify and then inside the class rasieevent NotifyEvent. Or if you pass the form to the object the object could use the form events. So if you wanted to check a condition in the Form_Load event and possibly raise an event in the object from that you could. Just make a private withevents Form variable in the object and then have a prop that Sets the passed form to that form.

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Thanks. Dont know why I didnt think of that... Duhh.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Lively Member
    Join Date
    Aug 2000
    Location
    Posts
    105
    Dear Cander ,

    I have the same problem , which I stuck with it for a week , so if you maneged to sulve this I would be thankfull if you could help me and show me how ypu did it.

    Thanks Moyalt.

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by Edneeis
    You could make a sub that triggers the event as part of the object. Like obj.Notify and then inside the class rasieevent NotifyEvent. Or if you pass the form to the object the object could use the form events. So if you wanted to check a condition in the Form_Load event and possibly raise an event in the object from that you could. Just make a private withevents Form variable in the object and then have a prop that Sets the passed form to that form.
    and we'r just getting out of 'goto and gosub hel'l
    -= a peet post =-

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