How to use VB.net forms in CS.net project

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a difficulty using already existant VB.net forms in the CS.net project.
Is it possible at all to work with both types of forms in the same cs project
If yes, please tell me how to do i

Thanks
 
Hi Peter,

It depends on what you are trying to accomplish.
If you compile your VB.NET form in an separate assembly (dll) and make your
form classes public you can use the form in the C# project as any other
class (reference that assembly in you project and go)

If you want to add VB.NET source files to your C# project then that is not
possible. Project has to be homogenous in terms of language.
 
Hi pkrikelis,

Thank you for posting in the community!

Based on my understanding, you have an existent VB.net class, you want to
use it in a C# project.

======================================
Just as Stoitcho said, you should compile the VB.net class into a dll, then
you can add the dll into the C# project as a reference and use it.

What I want to add is that: You can add a VB.net project into the same
solution with a C# project. Then in the C# project, you can add the VB.net
project as a reference.
Then in C# project, you also can use VB.net class.

But actually, this is almost the same as compile the VB.net class into a
dll, because everytime compile, the VS.net IDE will first compile the
VB.net project into a dll, then refer the dll into the C# project.

Hope the information helps you.

====================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi pkrikelis,

Does our reply make sense to you?

If you still have anything unclear, please feel free to tell me, I will
help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top