C#我想在窗体获得焦点的事件中写代码

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:57:33
C#我想在窗体获得焦点的事件中写代码
怎么写?
private void Form1_Activated(object sender,EventArgs e)
{
System.Windows.Forms.MessageBox.Show("215");
}
没反应?在线等!

private void Form1_Activated(object sender,EventArgs e)
{
System.Windows.Forms.MessageBox.Show("215");
this.Forcus();
}

你是直接写的代码么?有添加到事件中么?
在控件属性那个窗口有个小闪电的标志,里面是控件事件。