Specifies that one or more declared member variables refer to an instance of a class that can raise events.
Remarks
When a variable is defined using WithEvents, you can declaratively specify that a method handles the variable's events using the Handles keyword.
You can use WithEvents only at class or module level. This means the declaration context for a WithEvents variable must be a class or module and cannot be a source file, namespace, structure, or procedure.
You cannot use WithEvents on a structure member.
You can declare only individual variables—not arrays—with WithEvents.
Rules
Element Types. You must declare WithEvents variables to be object variables so that they can accept class instances. However, you cannot declare them as Object. You must declare them as the specific class that can raise the events.
The WithEvents modifier can be used in this context: Dim Statement
Μπορείτε να βρείτε την πηγή για αυτό το περιεχόμενο στο GitHub, όπου μπορείτε επίσης να δημιουργήσετε και να εξετάσετε ζητήματα και αιτήματα έλξης. Για περισσότερες πληροφορίες, ανατρέξτε στον οδηγό συνεργατών.
.NET σχόλια
.NET είναι ένα έργο ανοιχτού κώδικα. Επιλέξτε μια σύνδεση για να παρέχετε σχόλια:
Συμμετάσχετε στη σειρά meetup για να δημιουργήσετε κλιμακούμενες λύσεις AI που βασίζονται σε πραγματικές περιπτώσεις χρήσης με συναδέλφους προγραμματιστές και ειδικούς.