Erik,
"Erik Ekedahl" <ch*****@hotmial.com> schrieb:
I am a intermediate VB6 programmer moving to VB.NET using the book
"Programming Microsfot Visual Basic.net" (Microsoft Press)
I have understood so far what is going on but I am haveing a bit of
dificulty with events. My problem isn't syntax or howto or any of that, my
questions are:
What is the purpose of an event?
The purpose of an event is not notify event listeners. Classes, for
example, can subscribe to an event by providing an event handler and tieing
it to an object's event in order to get notified when the event is raised.
What is the "target" of the event (ie. who does what to whom)
An object raises an event if something is happening and other objects can
handle this event, which means that they can provide a method that is called
when the object's event is raised.
Is there a difference between events in a class that you made and events
in built-in classes
In general, there is no difference. There is a certain pattern that tells
how events should be implemented in reusable classes. You can find it in
the events documentation.
Events in VB.NET are very similar to those in VB6. I suggest to read the
documentation on events in Visual Basic .NET to understand the changes. If
you have any questions, feel free to ask them here.
Visual Basic Language Concepts -- Events and Delegates
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconEventsDelegatesInheritance.asp>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>