Is it possible to join a C # form to a VB.NET project?

8

I have two distinct projects, one with just one form in C #, can I embed the form in my project in VB.NET?

    
asked by anonymous 18.06.2015 / 06:13

2 answers

6

There are two options:

  • Convert c # code to vb.net, see this tool C # to Vb.NET Converter a>
  • As stated by Caffé, put the C # form in a separate project, and use the form in the VB.NET project.

To open the C # form in VB.NET, if the two projects are in the same solution:

Dim  csharpfrm As New ProjetoCSharp.Form1
csharpfrm.Show()

I'm currently missing Visual Studio, but to add the reference do the following: In the project with the C # form, click Project > options, and change the project type to dynamic library.

Compile the project (Build, build solution, I do not know how it is in Portuguese).

Next, in the VB project, in Solution Explorer, right-click the project, add, references, and find the .dll file in the C # project folder, bin \ release subfolder.     

19.06.2015 / 13:08
2

Create a project in the same solution in C # and another one in VB, in C # it puts your project, when you use this C # project in VB, reference it in your project.

    
23.06.2015 / 23:12