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

 怎樣讓TextBox得到焦點,TextBoxTabControl里面

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
个人分类: WinForm ASP.NET C#
上一篇怎樣讓TextBox得到焦點,TextBox控件在TabControl里面!How to focus TextBox control inside of TabControl?
下一篇GeoServer Part A
想对作者说点什么? 我来说一句

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

关闭
关闭