首页 新闻 会员 周边

C# winfrom的textbox的leave事件生效以后,怎么把焦点移到当前的文本框

0
悬赏园豆:15 [已解决问题] 解决于 2019-11-12 16:25

private void ntxt_menuname_Leave(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(ntxt_menuname.Text))
{
MessageBox.Show("请输入菜单号");
return;
}
}

大龙哥哦的主页 大龙哥哦 | 初学一级 | 园豆:25
提问于:2019-11-12 14:43
< >
分享
最佳答案
0
private void textBox1_Leave(object sender, EventArgs e)
{
    MessageBox.Show("somthing");
    (sender as TextBox).Focus();
}
收获园豆:15
会长 | 专家六级 |园豆:12401 | 2019-11-12 16:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册