Launch VB Form from C # Form
My friend and I were working on a project for a class. He prefers VB and I prefer C #, so we just did our thing. Now we were thinking about merging projects. I added it to mine, but I cant find how to open the forms it made from the forms I made.
Is there a way to launch VB forms from a C # form?
source to share
Can't mix C # into VB. but you can use the approach suggested by Jon Skeet.
1) Create multi-project solutions
2) Add your friend's VB project link to your project
Then you can create an object of those forms that your friend created as:
YourFriendProject.SomeForm someForm = new YourFriendProject.SomeForm();
someForm.Show();
source to share
The language is specific to the project. This means you have a C # project and a VB project. You cannot mix multiple languages ββin one project. However, you can have multiple languages ββin your solution. For example, it does the front-end in VB and you do the back-end in C # and then add references to the vb project in the C # project.
Alternatively, you can use the VB to C # converter or vice versa with mixed results. I have converted entire vb projects to C #.
source to share
The answer has already been posted, just adding an image to make things clearer.
- You cannot add forms / code from two different languages ββto the same project.
- You can add a project reference from a VB node to a CS assembly and vice versa.
- You can add the project to another solution to have access to both.
source to share