zoukankan      html  css  js  c++  java
  • 委托列子

      public  class card
        {
            public delegate void shua(object txt);
            public event shua shuashijian;



            public void yanzheng(string num, object txt)
            {
                if (num == "123")
                {
                    if (shuashijian != null)
                    {
                        shuashijian(txt);
                    }
                }
            }
        }

    public class shitang
        {
            public shitang(card m)
            {
                m.shuashijian += new card.shua(ob);
            }
            public void ob(object txt)
            {
                ((TextBox)txt).Text = "吃饭";
            }

        }


            private void button1_Click(object sender, EventArgs e)
            {
                card m = new card();
                shitang s = new shitang(m);
                m.yanzheng("123", textBox1);
            }

  • 相关阅读:
    隐藏 阴影 定位 js语法与导入
    js 相关知识
    选择器 常用样式 布局
    前端
    数据库 备份
    SQLAlchemy 创建 增 删 改 查
    引擎 索引 日志查询 权限管理
    pysql
    数据库的操作
    Conv1*1
  • 原文地址:https://www.cnblogs.com/net520/p/7953475.html
Copyright © 2011-2022 走看看