Jump to content

problem with codes in calling another form from another project

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
yerdaddy

yerdaddy

    Newbie

  • Members
  • Pip
  • 4 posts
i dont know whats wrong, i think ive done what i should have done
but the it still dont function

heres the code

'projectx' is the first project
'projecty' is the project that i added in projectx

imports projecty

private sub btnclck (bal bla)

dim frm as new projecty.formtobecalled
formtobecalled.show

end sub

in the error list it says "Reference to a non-shared member requires an object reference."

btw ive already added the projecty in the references

#2
thanasis2028

thanasis2028

    Learning Programmer

  • Members
  • PipPipPip
  • 31 posts
The problem is in this line:
dim frm as new projecty.formtobecalled
formtobecalled is not a class and therefore it can't be instantiated.
If you want to create a new form equal to formtobecalled use this instead
Dim frm as new windows.forms.form=projecty.formtobecalled
Hope this helps
My software company:Porosis Software
Games: Terrantula
Apps: Mathanasis, ColorGrabber (New!)