简体   繁体   English

VB textbox.focus()问题

[英]VB textbox.focus() problem

I cant seem to get VB to focus on a textbox correctly at the moment I did 我当时似乎无法让VB正确专注于文本框

TextBox.focus() TextBox.focus()

in the load event but still a button keeps grabbing focus anyway. 在加载事件中,但仍然有一个按钮仍然吸引焦点。 Does anyone know why this would happen? 有谁知道为什么会这样?

Try changing the tabindex property. 尝试更改tabindex属性。

in webforms, see http://www.w3schools.com/aspnet/prop_webcontrol_standard_tabindex.asp 在网络表单中,请参见http://www.w3schools.com/aspnet/prop_webcontrol_standard_tabindex.asp

in winforms View -> Tab Order when the desing view is open 在设计视图打开时,在winforms视图-> Tab顺序中

if that doesnt work, try calling the Select() method on your TextBox. 如果那不起作用,请尝试在TextBox上调用Select()方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM