using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace MyNamespace
{
public class UserControl1 : UserControl
{
private Button button1;
private Container components = null;
public UserControl1()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
private void InitializeComponent()
{
this.button1 = new Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new Point(48, 48);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new EventHandler(this.button1_Click);
//
// UserControl1
//
this.Controls.Add(this.button1);
this.Name = "UserControl1";
this.ResumeLayout(false);
}
#endregion
private void button1_Click(object sender, EventArgs e)
{
this.OnButtonClick(e);
}
public EventHandler ButtonClick;
protected virtual void OnButtonClick(EventArgs e)
{
if(this.ButtonClick != null)
{
this.ButtonClick(this, e);
}
}
}
}
|