如何在文本框的textchanged事件后设置焦点 [英] how to set focus after textchanged event of a textbox

查看:95
本文介绍了如何在文本框的textchanged事件后设置焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框。文本框事件触发后如何将焦点设置到下一个文本框

I have a text box.After textchaged event fire how to set the focus on to next textbox

<asp:TextBox ID="txtDrums" runat="server" CausesValidation="True" Height="23px"  AutoPostBack="true"

                   ontextchanged="txtDrums_TextChanged" TabIndex="3" Width="97px"></asp:TextBox>

推荐答案

如果你想将焦点设置在同一文本框中然后你可以使用 txtDrums.Focus()



如果你想把焦点放在其他控制上而不是使用 [ControlId] .Focus()
If you want to set focus on the same text box then you can use txtDrums.Focus()

And if you want to set focus on other control than use [ControlId].Focus()


您希望文本框聚焦的位置。

Wherever you want your textbox to be focused.
SetFocus(yourtextbox);



问候..:)


Regards..:)


这篇关于如何在文本框的textchanged事件后设置焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆