|
-
Mar 15th, 2000, 07:07 AM
#1
Thread Starter
Member
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.
-
Mar 15th, 2000, 07:41 AM
#2
Frenzied Member
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.
-
Mar 16th, 2000, 07:57 AM
#3
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|