Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declaring Objects
Message
De
26/12/2005 19:01:04
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01080778
Message ID:
01080887
Vues:
11
Luis,

I'm not big on VB syntax, but I believe in this case, the WithEvents clause is really not necessary (it's an optional clause in declaring variables). According to the help:

"The WithEvents keyword indicates that a declared object variable refers to a class instance that can raise events."

But, of course, Buttons and GroupBoxes can raise events anyway, so why bother using the WithEvents clause? That's probably why you don't see it for other controls on the form .... because it's really not necessary.

~~Bonnie



>I am rading code from a project of abook of visual basic net ,and the code of the form has part that says "Public Class FrmMain" ,after that appears the following lines
>
>
>Friend WithEvents GrbRegisteredCustomer As System.Windows.Forms.GroupBox
>Friend WithEvents CmdRegCustomer As System.Windows.Forms.Button
>
>
>But in other form does not appears where exists similar controls dont appear similar lines,why?
>
>thank you for the help
>
>Luis Martin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform