怎样创建一个.net的控件库项目?

liu_jc 2004-10-10 05:01:26
怎样创建一个.net的控件库项目?哪里有具体的例子。
...全文
124 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
北京的雾霾天 2004-10-11
  • 打赏
  • 举报
回复
你不用知道完整的工程,如果你用的是VS。NET的话可以新建一个这样的项目,但是如果你不用的话。就手写这样也差不多了,但是编译的选项选上是DLL的就可以了。原来这样写过可以现在都用VS。NET2003,那样写的方式都不用了。
liu_jc 2004-10-10
  • 打赏
  • 举报
回复
有完整的工程吗?
北京的雾霾天 2004-10-10
  • 打赏
  • 举报
回复
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace MyControlDll
{
/// <summary>
/// MyControlDllControl 摘要
/// </summary>
///
/// 警告: 如果您更改该类的名称,则需要更改
/// 与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。 否则,
/// 设计器将不能与此窗体关联的
/// 本地化资源正确交互。
public __gc class MyControlDllControl : public System::Windows::Forms::UserControl
{
public:
MyControlDllControl(void)
{
InitializeComponent();
}

protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::Button * button1;

private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container* components;

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->button1 = new System::Windows::Forms::Button();
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(64, 24);
this->button1->Name = S"button1";
this->button1->TabIndex = 0;
this->button1->Text = S"button1";
this->button1->Click += new System::EventHandler(this, button1_Click);
//
// MyControlDllControl
//
this->Controls->Add(this->button1);
this->Name = S"MyControlDllControl";
this->ResumeLayout(false);

}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
MessageBox::Show("Test");
}

};
}

7,540

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧