DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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.



Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links