call procedure in 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   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 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 form is already open.

Who is Participating?
So the VB.Net project is a Windows application. Is the C# project also a Widnows application? Or is the C# project .dll?

Anyways, please remember that an .EXE application has an application domain which makes its bounderies clear: its members are for itself. That means, it is impossible to let a C# project access the members of a VB.Net application project. But you can let the VB.Net application project access the members of the C# project.

What you can do is to create a VB.Net .dll that defines the member you wanted to share to other projects. You can then use this .dll in both your VB.Net app and your C# .dll.

Have fun.
Fahad MukhtarDistinguished EngineerCommented:
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

myCSharpClass c  = new myCSharpClass();

or without *using* keyword

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

OnlineNoobAuthor Commented:
I have sevearl C# classes uncompiled in my solution, along with my project.   I would like to call public procedure in the form class from within my c# class.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Check this url
It helps to convert code to c#.

Fahad MukhtarDistinguished EngineerCommented:
you can put your C# code in a dll and then acces in application easily...
I dont think you can use both C# classes in it in the same application
Fahad MukhtarDistinguished EngineerCommented:
It would be possible in the upcoming version of VS.Net
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.