如何从另一个类库中的表单访问另一个类库中的表单

如何从另一个类库中的表单访问另一个类库中的表单

问题描述:

你好,

我在两个不同的类库中有两种不同的形式

我想打开一个具有摄像头功能的表单,正在加载form1

如何执行此类任务,请提供代码帮助

关于bishnu

hi frens,

i have two different forms inside two different class library

i want to open a form which has camera feature is form1 is loading

how to perform such task please help with the code

with regards bishnu

首先构建您的Class Library,然后构建 ^ ]添加到它.
您现在可以在Class Library中使用Form,就像在.NET
中使用任何Class一样
First build your Class Library and then add a reference[^] to it in the Project you want to use it in.
You can now use the Form in your Class Library as you could use any Class in .NET
// Make sure you use the namespace of your Class Library.
MyClassLibrary.CameraForm camForm = new MyClassLibrary.CameraForm();
camForm.Show();