[CompilerGenerated]
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
[AccessedThroughProperty("SimpleButton1")]
private SimpleButton _SimpleButton1;
internal virtual SimpleButton SimpleButton1
{
[CompilerGenerated]
get
{
return this._SimpleButton1;
}
[MethodImpl(MethodImplOptions.Synchronized)]
[CompilerGenerated]
set
{
EventHandler value2;
value2 = SimpleButton1_Click;
SimpleButton simpleButton;
simpleButton = this._SimpleButton1;
if (simpleButton != null)
{
simpleButton.Click -= value2;
}
this._SimpleButton1 = value;
simpleButton = this._SimpleButton1;
if (simpleButton != null)
{
simpleButton.Click += value2;
}
}
}
When i decompile an vb.net application using ilspy, dnspy, just decompile, reflector, etc.
all the decompilers decompiles events in this format. so i cannot open the designer file. is there any other way to decompile properly?

What you are seeing is the code that the VB compiler generates for the
Sub X() Handles Field.Eventsyntax. The VB forms designer supports theHandlessyntax, but the C# forms designer does not have any direct equivalent. In C#, event handlers are typically registered directly in theInitializeComponentmethod, and do not automatically de/re-register when writing to the field.To get the designer working, you would need to:
InitializeComponent, not somewhere elseSimpleButton.Click += SimpleButton1_Click;into theInitializeComponent, e.g. so that it directly follows theSimpleButton = new Button()property assignment.SimpleButton.Click += new System.EventHandler(SimpleButton1_Click);I am not aware of any tools that would automate these steps.
Turning off the C# 2.0 feature "Use implicit method group conversions" in the decompiler settings can help with the
new EventHandlerportion.