Friday, July 31, 2009

C# How can I connect a dll file from class library to a button?

I have a button and would like to connect that button with a dll class file library (a class added by 'add reference'). I already have code inside that class that I would like to be executed when the button is pressed. Basically, how can I connect button1 to a class....is what I'm trying to say.

C# How can I connect a dll file from class library to a button?
Once you added your class, you should add a "using namespace" declaration where 'namespace' is the namespace you used in your DLL.





In the event handler of your button, you'll be able to reach your code of your DLL the same way you reach the code you've written in the same project : If I created a DLL with a namespace MyDll and class Calcul containint a static function Sum, i'd access it this way : MyDll.Calcul.Sum()


No comments:

Post a Comment