views:

42

answers:

1

I have a form and i drag and drop a control in VB.NET.

I have a line say,

private WithEvents radioButton RadioButton

Also, I have a handler like,

private void click(.....) Handles radioButton.Click
{
    ...
}

Now, When I build this is .NET 3.5 in release mode, and see the generated code in reflector tool, the code is something like,

Private Overridable Property radioButton As RadioButton
.
.
.
<AccessedThroughProperty("radioButton")> _
Private _radioButton As RadioButton

Can someone tell me what is going on here? And how do I avoid the generation of new properties and fields?

-datte

+2  A: 

The WithEvents/Handles construct is VB.NET syntax on top of the .NET Framework classes.
During the compilation process all language-specific keywords must be translated into the equivalent .NET Framework API calls, since that is what's available at runtime.

Related resources:

Enrico Campidoglio
Thanks for the quick answer... :)
dattebayo