Visual Studio and SharpDevelop do not both set up delegates to handle events in the same way. The way they are set up is a little bit different. This makes it difficult to use VS in one place and #Develop in another (on the same project).
For Example, in VB, Visual Studio does the following:
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close()
End Sub
And ...
Friend WithEvents OK_Button As System.Windows.Forms.Button
So that the control is declared, not only with a different scope (this can be a problem also, but not the topic of this post) but with a withevents. The event handler is then assigned to it by a handles clause.
in #Develop, it is done like this ...
Sub OK_ButtonClick(sender As Object, e As EventArgs)
End Sub
and ...
Private button1 As System.Windows.Forms.Button
Then, in the InitializeComponent method
AddHandler Me.button1.Click, AddressOf Me.OK_ButtonClick
The most annoying thing about this, is even if it is done one way, the other ide will redo it, having duplicate declarations, and of course, compile time errors.
Does anyone know of a way around this, some way to customize the default handlers? even if it is just some way that they can be turned off, so it can just be typed manually?