Incorporate one winform in several applications

Posted on 2004-11-14
Medium Priority
Last Modified: 2010-08-05
I have one winform and I want to include that winform in several windows applications develop in VB.net.  I do not want to include .resx and .vb files of that winform in each application.  I like somekind of reference  and I include that reference in teh application and it works.  I also like to have some parameters to be passed.  I do not know how to do it.  Please tell me how to do it.
Question by:tgatif
LVL 48

Accepted Solution

AlexFM earned 1000 total points
ID: 12581613
Create Class Library project and add form to it. In other projects (clients) you need to add reference to this Class Library (see References item in the Project Explorer). Having reference to class library you can create instance of any class from it.

Assisted Solution

checoo earned 500 total points
ID: 12583068
you can pass parameters to a form by over wirtting the new method of the form with some thing like below

private _strText as string

public sub new (byval strTest as string)

        'This call is required by the Windows Form Designer.

        'Add any initialization after the InitializeComponent() call
        _strText = strTest
end sub
LVL 14

Assisted Solution

ptakja earned 500 total points
ID: 12585668
To add parameters, simply add Public or Friend scoped Properties to the Form Class.


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question