如何从dll文件访问表单控件 [英] how to access form control from dll file

查看:78
本文介绍了如何从dll文件访问表单控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是C#编程的新手.请帮助我解决以下问题:
我正在处理我已经创建了dll文件的应用程序,我想从dll文件的控件中访问该文件.可能吗??以及如何使用.dll文件制作.exe文件?


i am new in C# programming.please help me following problem:
i am working on application in which i have created dll file i want to access from''s control from dll file. is it possible?? and how to make .exe file with .dll file??

推荐答案

这是可能的-您只需要一种方法即可将控件的引用传递给您库.
但这不是一个好主意,特别是如果您在库中进行多线程处理.

相反,您应该设计您的库以接收数据,并且表单的代码应访问控件并将数据传递给库.
It''s possible - you just need a way to pass control''s reference to your library.
But it''s not a good idea, especially if you have multithreading going on inside library.

Instead you should architect your library to receive data and form''s code should access controls and pass data to library.


这篇关于如何从dll文件访问表单控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆