Link to home
Start Free TrialLog in
Avatar of OnlineNoob
OnlineNoob

asked on

call procedure in vb.net form class from c# class?

hi all,

I don't code in c# and know little about it, but I have a library of code that I'm using.   Primarily I code in vb.net.   I have added error handling within many of the functions and procedures of the c# library classes.   I would like to call a procedure that is in my vb.net form from within my c# code.   Can someone please show me how I can do this?   The procedure is just a one liner name, no parameters to pass or anything.   also, the vb.net form is already open.

regards
Avatar of Fahad Mukhtar
Fahad Mukhtar
Flag of Pakistan image

if you meant to say that you have a class library written in C# then you can easily use that DLL in your VB.NET Code. Just click *Project-> Add Reference* menu and browse for the C# DLL.  Then you can easily use the classes in that DLL by using either

using MYCSHARPDLL;
.................
myCSharpClass c  = new myCSharpClass();
c.myCsharpFunction();


or without *using* keyword

MYCSHARPDLL.myCSharpClass c  = new MYCSHARPDLL.myCSharpClass();
c.myCsharpFunction();

Avatar of OnlineNoob
OnlineNoob

ASKER

I have sevearl C# classes uncompiled in my solution, along with my vb.net project.   I would like to call public procedure in the vb.net form class from within my c# class.
Hi,
Check this url http://www.codeproject.com/csharp/GBVB.asp
It helps to convert vb.net code to c#.

Cheers
Sukumar
you can put your C# code in a dll and then acces in vb.net application easily...
I dont think you can use both C# classes in vb.net it in the same application
It would be possible in the upcoming version of VS.Net
ASKER CERTIFIED SOLUTION
Avatar of etmendz
etmendz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial