开发者

Use .dll files in winforms

开发者 https://www.devze.com 2023-01-24 08:59 出处:网络
I have a .dll file.I want to add this file to my program and use the component of its.(in C# &am开发者_StackOverflowp; winforms)

I have a .dll file.I want to add this file to my program and use the component of its.(in C# &am开发者_StackOverflowp; winforms) How do I can do this? Thanks.


Right click your WinForms project and say Add Reference, then browse to the DLL.

I tend to put any third-party DLLs in a folder called "Dependencies" inside my solution so that they are all kept together. It also makes it easier to move the solution around.


Add it as a reference to your project and then provide a using in any source file where you want to import the namespace to use the types within the DLL.


You should first put the .dll in your application folder. If there is an accompanying xml file, put that in there too. The XML file is the detailed comments so when you work with the .dll it will have explanations for things.

Right click on your project in solution explorer and choose add a reference. Choose the dll thats in your project.

If the dll is name Company.Description.dll, put a using command at the top of your code:

`using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Company.Description;`

You should be able to see what the dll has added by typing in Company.desciption. hit control + space bar. The intellisense should show you what that dll contains.


Add reference from Solution Explorer (Remember you can add only managed code DLLs)
or
if using windows form you can also add control to Toolbox
Right Click on Toolbox ->Choose Items... ->Browse for your dll

0

精彩评论

暂无评论...
验证码 换一张
取 消