如何将值从一页传递到dll [英] how to pass values from one page to dll
问题描述
大家好
我正在基于.net Windows的应用程序中工作.
我为每个页面创建dll.但是在那些页面中,我想将值从frmmenuscreen传递到那些单独的屏幕.如何将值传递给dll.i不能像
Hi all
Im working in .net windows based application.
Iam creating dll for each pages.but in those page i want to pass a value from frmmenuscreen to to those individual screens.How to pass values to dll.i cannot use like
frmmater obj_co=new frmmaster; obj_co.obj = this;
错误那样使用,主要是添加第二行此关键字.为此
在此先感谢
error coming wile adding second line mainly this keyword.how to dothis
Thanks in advance
推荐答案
您第一次调用frmmater几乎是正确的.
Hi,
your first invoke of frmmater is nearly right.
frmmaster obj_co = new frmmaster();
您的第二段代码对我来说毫无意义.
通常,您使用这样的自己的dll文件.您必须声明您的方法公开以从外部使用.
在您的dll中:
Your second piece of code makes no sense for me.
Usually you use a own dll-File like this. You have to declare your method public to use from outside.
in your dll:
public class Calculator
{
public double Add(double val1, double val2)
{
return val1 + val2;
}
}
此dll在任何形式下的用法:
Usage of this dll in anyone Form:
Calculator.Calculator calc = new Calculator.Calculator();
MessageBox.Show(calc.Add(9, 6).ToString());
此致
Best Regards
这篇关于如何将值从一页传递到dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!