更新时间:2023-12-05 23:51:10
1.创建Control
.您可以继承ComboBox
,UserControl
,Control
,Form
或NativeWindow
.
2.也将其添加到您的Form
.您可以从工具箱中选择它,也可以在Form
的构造函数中添加逻辑.
1. Create theControl
. You may inheritComboBox
,UserControl
,Control
,Form
orNativeWindow
.
2. Add it too yourForm
. You may either select it from the toolbox, or add the logic in yourForm
''s constructor.
如果您不熟悉C#,则应该学习使用控件在考虑编写自己的控件之前就已经存在.
If you''re new to C#, you should learn to use the controls that exist before you consider writing your own control.
假设这是一个扩展的dll,最简单的方法是:
右键单击工具箱",然后单击选择项目".
浏览",找到dll,然后单击确定".
现在,您可以像其他控件一样将其从工具箱中拖放,您的项目引用将自动更新.
Assuming this an extenal dll the easiest way is:
Right click on the ToolBox and ''Choose Items''.
''Browse'', find the dll and click OK.
Now you can drag and drop it from the ToolBox like any other control and your project references will be updated automatically.