Hi ..
I am trying to open a 2nd form with a reference to the mainform
Code...
Dim frm As New Form2(Me)
frm.Show()
A wigly shows under (Me) with error message
Too many arguments to 'Public Sub New()'.
Printable View
Hi ..
I am trying to open a 2nd form with a reference to the mainform
Code...
Dim frm As New Form2(Me)
frm.Show()
A wigly shows under (Me) with error message
Too many arguments to 'Public Sub New()'.
Add an argumet to the second forms Sub New method. Something like this.
Dim mainForm as Form
Sub New(mForm as Form)
MyBase.New()
mainFom = mForm
InitializeComponent()
End Sub
Now you should be able to pass the Me object to the form and have the reference to it in the variable mainForm.
Thanks a million, much appreciated :D