focus()不是切换 [英] focus() is not switching

查看:79
本文介绍了focus()不是切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在选择 Enter键时,系统应执行以下操作并将焦点切换为

 txt_Interest.Text; 



然而事实并非如此。我该如何更正?



谢谢



  protected   void  txt_Principal_TextChanged( object  sender,
EventArgs e)
{
decimal Kprincipal = Convert.ToDecimal(txt_Principal.Text);

txt_Principal.Text = Kprincipal.ToString( N);
txt_Interest.Focus();
}

解决方案

尝试



 txt_Interest.Select(); 





希望这会有所帮助,

CodeFate。


On selecting the Enter key the system should do the following and switch focus to

txt_Interest.Text;


However it doesn't. How do I correct this?

Thanks

protected void txt_Principal_TextChanged ( object    sender, 
                                           EventArgs e)
     {
     decimal Kprincipal = Convert.ToDecimal ( txt_Principal.Text );

     txt_Principal.Text = Kprincipal.ToString( "N" );
     txt_Interest.Focus ( );
     }

解决方案

Try

txt_Interest.Select();



Hope this helps,
CodeFate.


这篇关于focus()不是切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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