用C#在VS2008平台下编程,如何建立接口,接口又如何连接。要详细点的代码!
2个回答
展开全部
首先定义一个接口名称Interface,写入一个类,并给主程序添加引用。子程序中写
public partial class Form1 : Form
{
public static bool Add;
private InterFace.UserManagement Manage;
public InterFace.UserManagement userManage
{
set { Manage = value; }
}
接下来实现功能。主程序中写
private UserManagementForm.Form1 UMForm;
public Form1()
{
}
private void Form1_Load(object sender, EventArgs e)
{
PopLoginForm();
UserManagementForm();
}
private void UserManagementForm()
{
UMForm = new UserManagementForm.Form1();
UMForm.userManage = this;
UMForm.ShowDialog();
}
接下来就实现各种控件以及BUTTON。注意要将接口文件.DLL拷贝到项目文件夹中。
public partial class Form1 : Form
{
public static bool Add;
private InterFace.UserManagement Manage;
public InterFace.UserManagement userManage
{
set { Manage = value; }
}
接下来实现功能。主程序中写
private UserManagementForm.Form1 UMForm;
public Form1()
{
}
private void Form1_Load(object sender, EventArgs e)
{
PopLoginForm();
UserManagementForm();
}
private void UserManagementForm()
{
UMForm = new UserManagementForm.Form1();
UMForm.userManage = this;
UMForm.ShowDialog();
}
接下来就实现各种控件以及BUTTON。注意要将接口文件.DLL拷贝到项目文件夹中。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询