Community discussion forum

Open form from another project in 1 solution

Tags: Indonesia
  • 1 year ago

    hiiiiiiiii,
    i've 2 projects in 1 solution, 1st project Name is X then 2nd project name is Y...
    So i want open the form (Form_Tes) in Y project from X project..
    Please advise

    Thanks

  • 1 year ago

     

    Hello,

    To open a form of another project, you need to reference the project Y in project X. For that, you need to rebuild the entire

    solution to create the exe file of Project Y available in the bin folder. Then you need to add the references of the Project Y exe in the

    Project X.

    We will also have to import the project Y namespace in our project X using Import keyword.

    Imports ProjectY

    Then lets say on a button click, you may use the following code:

    Dim frm As New Project2.Form1

    frm.ShowDialog()

    I hope this will help.

     

    Regards,

    Allen Smith
    ComponentOne LLC

    www.componentone.com

     

     

     

  • 1 year ago

    Why i can't add reference of the project Y.. i got error message "This is not assembly or COM Component"..

    FYI , i'm using vb.net 2003..

    thanks, please advice

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!