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

  • 相关阅读:
    笨蛋蛋都能学会的开机grub消除(双系统开机总是黑屏肿么办--多半是欠reset)
    Find a way HDU
    非常可乐 HDU
    Oil Deposits HDU
    迷宫问题 POJ
    Fire!
    Fire Game FZU
    Pots POJ
    Prime Path POJ
    Jquery鼠标悬停按钮图标动态变化效果
  • 原文地址:https://www.cnblogs.com/net520/p/7953475.html
Copyright © 2011-2022 走看看