在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
form1: private void button1_Click(object sender, System.EventArgs e) { Form2 frm = new Form2(); frm.OnSendString += (text) => { textBox1.Text = text; }; frm.Show(); } form2: public delegate void SendStringHandler(String text); public event SendStringHandler OnSendString; private void button1_Click(object sender, EventArgs e) { if (OnSendString != null) { OnSendString("在WinForms程序里实现窗体传值的最佳实践"); } }
m_dlg.TextBoxChanged += new EventHandler( (sender1, e1) => { richTextBox1.Text = m_dlg.TextBoxValue; } ); =>相当于
|
请发表评论