事件 可能我描述的不太清楚,就是怎么才能我查公布出去TextBox.Leave事件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public delegate void BeginEventHandler(string text);class 里面 public event BeginEventHandler OnBegin;触发 if (OnBegin != null) OnBegin("Begin."); //假设CTR是你那个复合类: public class CTR{ private TextBox txt; private Button btn; public delegate void LeaveHandler(object sender,EventArgs e); public event LeaveHandler Leave; public CTR(TextBox txt, Button btn) { this.btn = btn; this.txt = txt; txt.Leave += new EventHandler(txt_Leave); } void txt_Leave(object sender, EventArgs e) { this.OnLeave(e); } void OnLeave(EventArgs e) { if (Leave != null) { Leave(this, e); } } }//使用示范,先在form1上画textBox1和button1 public partial class Form1 : Form { public Form1() { InitializeComponent(); CTR ctr = new CTR(textBox1, button1); ctr.Leave += new CTR.LeaveHandler(txt_Leave); } void txt_Leave(object sender, EventArgs e) { MessageBox.Show("123"); } } 关于div遮罩无法显示 关于winform net软件打包问题 为什么控件做好后,想移动位置,都拖不动啊 app.config 问题 新手请教,textBox 与 dataGrid 的数据同步 请问在哪可以下载Microsoft Navision 4.0 啊? 局域网内教师机如何监控学生机屏幕? 用C#读写XML实例?怎么写? 如何新建只有一个窗体时只有*.cs而没有*.resx和*.designer.cs??? 如何知道软驱中是否放了软盘? Theard的困惑 c#.net窗体程序中如何操纵Access数据库?
public event BeginEventHandler OnBegin;
触发 if (OnBegin != null)
OnBegin("Begin.");
private TextBox txt;
private Button btn;
public delegate void LeaveHandler(object sender,EventArgs e);
public event LeaveHandler Leave;
public CTR(TextBox txt, Button btn)
{
this.btn = btn;
this.txt = txt;
txt.Leave += new EventHandler(txt_Leave);
} void txt_Leave(object sender, EventArgs e)
{
this.OnLeave(e);
}
void OnLeave(EventArgs e)
{
if (Leave != null) {
Leave(this, e);
}
}
}//使用示范,先在form1上画textBox1和button1 public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
CTR ctr = new CTR(textBox1, button1);
ctr.Leave += new CTR.LeaveHandler(txt_Leave);
}
void txt_Leave(object sender, EventArgs e)
{
MessageBox.Show("123");
}
}