如何用C#来编写ActiveX控件

来源:百度知道 编辑:UC知道 时间:2024/05/16 05:53:07
如何用C#来编写ActiveX控件,然后怎么在.htm页面中使用,我用的是VS2005,希望大家帮我一下,谢谢
请帮我写一个简单点的例子

首先,建立一个WinForm控件项目HelloWorld,并拖入一个Label控件,文字设为HelloWorld

UserControl1.cs内容如下:

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace HelloWorld
{
/**//// <summary>
/// UserControl1 的摘要说明。
/// </summary>
public class Demo : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Label label1;
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Demo()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();

// TODO: 在 InitComponent 调用后添加任何初始化

}

/**//