Results 1 to 3 of 3

Thread: withevents event raiseevent questions.

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Fremont, Ca, 94538
    Posts
    40
    Hello, i've recently read about article of Sam. He uses withevents, event and raiseevent in his project. Can anyone explain for me about them? thank you.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Strange, I don't remember righting any articles.

    anyway, if you want to use events in your usercontrols, forms and class modules then you can.

    first you have to declare your events, in the classmodule or usercontrol, say you have an event Hello, with a parameter x a an integer. (Don't ask me why.)

    Declare it with

    Code:
    Event Hello(x as integer)
    then at anypoint in the usercontrol code you want to fire event just go

    Code:
    RaiseEvent Hello(3)
    it doesn't have to be 3 obviously it can be any integer you want.

    if you have your events in a class module you have to declare your class with

    Code:
    Dim Withevents objWhatever as new Class1
    instead of
    Code:
    Dim objWhatever as new Class1
    class modules are a bit funny with events there all right when they're contained in other class modules but they're a bit funny when thay're contaned in forms.

    Hope this helps.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 1999
    Location
    Fremont, Ca, 94538
    Posts
    40
    heh, actually it's sam huggill who wrote the article, but thanks a lot for the info.

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