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);
            }

  • 相关阅读:
    Java实现对zip和rar文件的解压缩
    executssql 函数的每一句代码的意思
    ConnectString ()函数的介绍
    ADODB——RecordSet对象
    Mrc.EOF
    论数据库
    uniGUI之新窗口uniForm(19)
    uniGUI之学习方法(18)
    uniGUI之换肤(17)
    uniGUI之多页面框架(16)
  • 原文地址:https://www.cnblogs.com/net520/p/7953475.html
Copyright © 2011-2022 走看看