In our VB.NET code, we are using many event handlers.
For below line of code we are getting the syntax error "BC30469 Reference to a non-shared member requires an object reference" where we use an optional parameter in the function signature:
AddHandler TabControl.Click, AddressOf FrmMW.ProcessTabClickEvent
where the function signature is
Public Sub ProcessTabClickEvent(sender As System.Object, e As System.EventArgs, Optional OpenNewTab As Boolean = False)
But for the below case, i.e. without optional parameters, we are not getting the syntax error:
AddHandler menuItem.Click, AddressOf SelectAllAction
where the function signature is
Private Sub SelectAllAction(ByVal sender As Object, ByVal e As EventArgs)
Please assist in solution. Our code is getting built successfully in VB Express 2010, but we are getting this error in VB Express 2017.