How to raise event using addHandler

后端 未结 4 774
轮回少年
轮回少年 2021-02-15 15:54

I am comfortable with Vb.Net events and handlers. Can anybody will help me with how to create event handlers in c#, and raise events.

4条回答
  •  轮回少年
    2021-02-15 16:23

        public MyClass()
        {
            InitializeComponent();
            textBox1.LostFocus += new EventHandler(testBox1_LostFocus);
        }
    
        void testBox1_LostFocus(object sender, EventArgs e)
        {
            // do stuff
        }
    

提交回复
热议问题