码迷,mamicode.com
首页 > 其他好文 > 详细

button事件驱动

时间:2014-11-19 12:08:05      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:io   ar   sp   for   on   div   art   cti   bs   

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyFirstApp
{
    public partial class FrmMain : Form
    {
        public FrmMain()
        {
            InitializeComponent();
            this.button1.Click += new EventHandler(btn_Click);
            this.button2.Click += new EventHandler(btn_Click);
            this.button3.Click += new EventHandler(btn_Click);
        }
      
        private void btn_Click(object sender, EventArgs e) 
        {
        Button btn = (Button)sender;
            MessageBox.Show(btn.Text);
        }
    }
}

button事件驱动

标签:io   ar   sp   for   on   div   art   cti   bs   

原文地址:http://www.cnblogs.com/LMzj/p/4107624.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!