Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Integrating VB.NET forms/code into a C#.net project

Hi,

     I wrote a set of maintenance forms to go with my coworker's project.  The problem is he wrote the project in C#, and I wrote the maintenance forms in vb.net.  How can he import those forms into his project?  He thought there'd be no problem, but he says he can't get it to recognize them.

JP
0
gleznov
Asked:
gleznov
  • 3
  • 2
4 Solutions
 
Bob LearnedCommented:
You can't mix VB.NET and C# within the same project (until Visual Studio.NET 2005).  You would need to create the VB.NET project as a DLL, and then add a project reference to the project, within the solution, to the VB.NET project.

Bob
0
 
mpf1748Commented:
You can add your project to his solution. Also, you will need to add a reference to your project from your coworker's. You will have two seperate projects, but you should be able to call your forms from his project.
0
 
gleznovAuthor Commented:
mpf:

ok so I import my project, then say I want his menu item to call up my form.  What would the code under that menu item look like?  On my project, the form I want to call is, say, "Maint1"

JP
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Bob LearnedCommented:
C#:

VBProject.Maint1 frm = new VBProject.Maint1;
frm.ShowDialog();

I made some assumptions about the namespace for the VB.NET form (VBProject).  You can put the real namespace value in place of that.


Bob
0
 
gleznovAuthor Commented:
When you said I'll need to add a reference to my project from my coworker's, what does that entail?  Project -> Reference -> and then whatever the add-your-own is?

JP
0
 
Bob LearnedCommented:
When the VB.NET project is added to the C# solution, then Project | Add Reference | Projects tab.  The VB.NET project should be displayed in the list.  Double-click to select, and click <OK>.

Bob
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now