Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declaring Objects
Message
From
26/12/2005 19:01:04
 
 
To
25/12/2005 11:13:04
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01080778
Message ID:
01080887
Views:
10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform