G
Guest
Hello,
I have a child form in an Mdi Parent form. I have 5 menu buttons on the
Parent that I use to show the child form. Originally, in the Parent form on
load event I had this line of code
frmChild.MdiParent = Me
But then, I added an argument to the constructor of the child form. Now I
get the error message for the line of code frmChild.MdiParent = Me. Error
say:
"Reference to a non-shared member requires and Object Reference"
So in each of the Menu buttons I now have
Dim frm As New frmChild
frm.MdiParent = Me
frm.Show
I want to eliminate the redundant line of code frm.MdiParent = Me. How do I
make the Child form shared? I tried placing the word "Shared" next to the
constructor of frmchild, but got an error. How to make the form shared?
Thanks,
Rich
I have a child form in an Mdi Parent form. I have 5 menu buttons on the
Parent that I use to show the child form. Originally, in the Parent form on
load event I had this line of code
frmChild.MdiParent = Me
But then, I added an argument to the constructor of the child form. Now I
get the error message for the line of code frmChild.MdiParent = Me. Error
say:
"Reference to a non-shared member requires and Object Reference"
So in each of the Menu buttons I now have
Dim frm As New frmChild
frm.MdiParent = Me
frm.Show
I want to eliminate the redundant line of code frm.MdiParent = Me. How do I
make the Child form shared? I tried placing the word "Shared" next to the
constructor of frmchild, but got an error. How to make the form shared?
Thanks,
Rich