UserControl1.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:2k
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Windows.Forms;
- namespace ControlDemo
- {
- /// <summary>
- /// Summary description for UserControl1.
- /// </summary>
- public class UserControl1 : System.Windows.Forms.UserControl
- {
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- public UserControl1()
- {
- // This call is required by the Windows.Forms Form Designer.
- InitializeComponent();
- // TODO: Add any initialization after the InitComponent call
- }
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if( components != null )
- components.Dispose();
- }
- base.Dispose( disposing );
- }
- #region Component Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(64, 40);
- this.button1.Name = "button1";
- this.button1.TabIndex = 0;
- this.button1.Text = "button1";
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(32, 104);
- this.button2.Name = "button2";
- this.button2.TabIndex = 1;
- this.button2.Text = "button2";
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // UserControl1
- //
- this.Controls.Add(this.button2);
- this.Controls.Add(this.button1);
- this.Name = "UserControl1";
- this.ResumeLayout(false);
- }
- #endregion
- private void button2_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show("test");
- }
- }
- }