link forms in different projects


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: link forms in different projects

  1. #1
    vb sisko Guest

    link forms in different projects


    when i press a button in form1 of project1 i want to open form1 of project2
    i want the code.

  2. #2
    Jaideep Guest

    Re: link forms in different projects


    In VB all form objects are private ot the project and are not accessible to
    other projects. Yet there is a workaround for the problem.

    Assuming Project1 is a Standard EXE and project2 is an ActiveX DLL

    Add a Class Module to Porject2 with Instancing property set to MultiUse.

    And Define the following function

    Private mfProj2Form as Project2.Form1

    Public Function ShowForm() as Object
    set mfProj2Form = new Project2.Form1
    Load mfProj2Form
    mfProj2Form.Show
    set ShowForm = mfProj2Form
    End Function


    In Project1, in the Button Click event create an object of Project2.Class1
    and call this method and save a reference to the form object returned by
    the method.

    - Jaideep
    "vb sisko" <tomaras@mail.gr> wrote:
    >
    >when i press a button in form1 of project1 i want to open form1 of project2
    >i want the code.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center