CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    16

    How to raise a event in a user-defined class module and handle this event by the same class module?

    Hi! Everybody!
    I meet a question. How i can raise a event in a user-defined class module and i want use one function to handle this event in the same class module? It means i want to event source and the event sink in the same class! How can i achieve it?
    Thank you anybody's help!
    Thank you very much!


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to raise a event in a user-defined class module and handle this event by the same class modu

    excerpt from the Visual Basic documentation (heading: "Adding Events to Classes"):
    "Events cannot be handled within the class that declared them."


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: How to raise a event in a user-defined class module and handle this event by the same class modu

    Hi

    VB doesn't allow you to raise errors and catch them in the same class.

    - Couldn't you just call a private method in your class when you need to ?


    Regards

    Chris Eastwood

    CodeGuru - the website for developers
    http://www.codeguru.com/vb



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

Featured