I have two projects. One is GUI, and the second is DLL.
I Call a function In DLL from Form1
The DLL function has to interface the form (Say, Change Back Color)
I would like to get the Calling form as a reference, without passing as parameter.
Here is Example from Form 1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ChangeBackColor()
End Sub
DLL function
Public Sub ChangeBackColor()
Dim CallingForm as Form
'''GET PARENT HERE'''
CallingForm.BackColor = Color.Cyan
End Sub
Obviously, I can do this if I pass Form every time, But trying to avoid that. Thank in advance
Someone Noted this question has been answered elsewhere. It has not been answered (or asked) as far as I could see. This is specific to Referencing a Form, not a method or other Object.
I have gotten the solution to reference the calling form, by referencing Form.ActiveForm And am now answering my own question below.