Question Reference to a non shared member requires an object reference.

Joe1

Active member
Joined
Dec 4, 2012
Messages
37
Programming Experience
Beginner
I am receiving this error (reference to a non shared member requires an object reference) when trying to make a previously hidden form visible using the code

ParameterSelection.Show() on a winform called parameterview.

I have tried to get round this problem by using;

Dim frm As New ParameterSelection
frm.show()

But this obviously opens a new version of the window, so the selections made on the previous one are not saved.
Is there any other ways around this problem?
 
Dim frm as ParameterSelection = Ctype(my.application.openforms("ParameterSelection"), ParameterSelection)
 
Thanks for your help.

This just now gives an error saying openforms is not a member of My.MyApplication
Any ideas?
 
Dim variableName as FormName = Application.OpenForms.Item("FormInstanceName")


I typed out the last sample without testing it. Try this one. Removed the My and added .item :)
 
This just now gives an error saying openforms is not a member of My.MyApplication
Any ideas?
It sounds as you haven't enabled application framework for project, which would be a bit weird as it is enabled by default.
Lotok said:
Removed the My and added .item
Item is default property and need not be specified, ..OpenForms("name") is valid.
Joe1 said:
I am receiving this error (reference to a non shared member requires an object reference) when trying to make a previously hidden form visible using the code

ParameterSelection.Show() on a winform called parameterview.
Default form instances has been around since VB 2005, weird again.
 
Back
Top