I have something like this
public class something : Inherits NativeWindow
Private WithEvents form As Form
Public Sub New(ByVal form As Form)
Me.form = form
End Sub
end class
The usage is this:
new something(Me)
I would like to know if it's possibly in C#
or VBNET
using reflection or something else to detect the calling Form instead of passing it as a parameter, something like this:
public class something : Inherits NativeWindow
Private WithEvents form As Form
Public Sub New()
Me.form = (callingform) ' If I call this from Form1 Class then the expected result is that Form1.
End Sub
end class
So the usage should be this:
The usage is this:
new something()
This is because my class inherits a NativeWindow
and I need to assign the handle to the calling form.
(I want to avoid the solution of inheriting a Form instead of a NativeWindow).