怎樣讓TextBox得到焦點,TextBox控件在TabControl里面!How to focus TextBox control inside of TabControl?

 


TabControl1.Focus()

 if(this.txtEmployeeCardId.CanFocus)
    {
     this.txtEmployeeCardId.Focus();
    }

 

解決辦法:

Are you trying to do this from, say within Form.Load? If so, try code like

Me.ActiveControl = Me.TextBox1!

 

可以使用this.ActiveControl = this.txtEmployeeCardId;

 if(this.txtEmployeeCardId.CanFocus)
    {
     this.txtEmployeeCardId.Focus();
    }

阅读更多
文章标签: textbox
个人分类: ASP.NET C#
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

怎樣讓TextBox得到焦點,TextBox控件在TabControl里面!How to focus TextBox control inside of TabControl?

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭