I need to call d class library on the click event of button,its in the same project,I don't know hw to call this,please tell me the steps which i need to follow for this,plz give sm examples,i m new to this....

Recommended Answers

All 5 Replies

What do you mean by call d class library ?

I hv written my code in the class file,nw i need to call this class file on windows form,on the click of a button,i dnt knw hw to do this........

First : stop writing sms-english, I don't like that.
Second : what I can decypher from your phrasing is that you have a button on a form and you want to call code you have written in a separate class. Am I correct?

I want to call this class Library file in my Windows Form,on the click event of the button

Something like this?

private void MyButton_Click(object sender, EventArgs e)
{
    MyClass TheClass = new MyClass(); //make instance
    TheClass.Method1(); //execute method 
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.