Using forms from one project in another one


Author
Message
Thomas Holste
Thomas Holste
Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi there,

I have a VB.NET 2010 application consisting of a some projects
in a project map containing the main-project which contains the baseforms and approx.
120 forms build on these baseforms.
Now I need a second app which shall use some of the forms of this project.
Are there possibilities to use these forms also in another project and if so,
what is the best way to do this?

Thanks in advance

Thomas
StrataFrame Team
S
StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)StrataFrame Developer (6.3K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can reference the assemblies (projects that contain the forms you want to reuse) from within your new application.  I'm pretty sure you can even reference another application (.exe) if that's where your forms are; they don't necessarily have to be in a Class Library (.dll).  An .exe is simply an assembly with an entry point.
Thomas Holste
Thomas Holste
Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ben,

thanks a lot for your help. After rethinking my problem a while I decided to move the forms and baseforms out of my main-programm into two new projects, one for the base-forms and another one for the inherited forms which will be used in one more programs.

When I created the projects I used the setting "Strataframe Windows Application" which works, but I was wondering if the settimg "Business Object Library" is something special for BOs or just the same as a windows classlibrary? I also add the steps i did to test it with one base- and one inherited form, maybe you can telle me, if I missed something.

Best regards

Thomas

This is my first test:

I created a form based on a baseform and run my app. It worked as expected.
I cut the baseform from my project named "Gal2G" and copied it to a new project named "Gal2GBaseforms".
In the new project I set somw references to other projects needed (Controls, Business Objects etc.)
In my main project I set a reference to the new project.  At a first run I had an error which happended because
some resources  I commented the lines which contained the now wrong referenece to the main-projects
resource file and it worked. Then I build a new resource-file in the base-forms-project and changed the
reference in the designer-code of the form

From       Inherits Gal2Grms.MySFSingleDataForm

To            Inherits Gal2GBaseforms.MySFSingleDataForm

and set the reference to the images in the base-form also from "Gal2G" to "Gal2GBaseforms".

Now it looks to me as this is working.

The second step was to create another new project to host the Forms which I have to take out from the main
project. I Cut and copied the form "Testmove" to the new project, set some some references and included an
"Imports Gal2GForms" in the main program and this worked too.
Thomas Holste
Thomas Holste
Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)Advanced StrataFrame User (502 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ben,

when I put my base-forms in an windows-application I cannot select them when I want to add a new form and chose the option "Inherited Form" ( Ihope this is correct translated as I use a german version of VS.

Then I created a BO-Librarary-project. added a baseform, compiled it to a DLL and now I can choose from this DLL.

Reusing a form from another project in another project works by just adding the form by chosing it in the file-explorer, as long there are references set to the project which can of the type "Windows-Application".

If I haven't missed a thing, this could be the solution.

Best regards

Thomas
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search