Tab键问题 [英] Tab key issue

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

问题描述

我只有几个TextBox.当我在TextBox es中说向上"箭头时,它应作为"Shift + Tab"功能使用,即光标应切换到以前索引的TextBox.
我可以完美地使用代码

I have few TextBoxes. When i say "Up" arrow in the TextBoxes it should work as "Shift+Tab" functionality i.e cursor should switch to previous indexed TextBox.
I''m able to work perfectly with code

private void txtdeposit_KeyDown(object sender, KeyEventArgs e)
{
  if (e.KeyCode == Keys.Up)
   {
    SendKeys.Send("+{TAB}");
   }
}



但是问题是,当任何文本框中有文本时,向上"箭头功能将不起作用.但是我可以在没有文本的情况下工作...建议我....



But the issue is when there is text in any textbox then "Up" arrow functionality is not working. But I''m able to work when there''s no text...Suggest me....

推荐答案

有一种做你自己的方法当前不直接使用SendKeys或任何其他API函数的方式.

看看 Control.GetNextControl [ ^ ].

我之所以说直接对进行排序",是因为我怀疑该方法在肠中使用了SendKeys.因此,我不确定它是否可以解决您的问题.不过,请尝试一下,您永远不会知道.

祝你好运. :)
There is a way to do what you are currently doing without resorting directly to SendKeys, or any other API function.

Take a look at Control.GetNextControl[^].

The reason that I said ''resorting directly'' is that I suspect that the method uses SendKeys down in the bowels. Therefore I am not sure that it will solve your problem. Still, give it a try, you never know.

Good luck. :)


这篇关于Tab键问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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