hii在按钮单击事件中,我想调用"Tab"标签.或“太空"手动地 [英] hii in a button click event i want to invoke the "Tab" or "Space" manually

查看:72
本文介绍了hii在按钮单击事件中,我想调用"Tab"标签.或“太空"手动地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在按钮单击事件中,我想自动调用制表符"或空格",而无需按下键盘上的制表符或空格..我如何实现此任务,请帮帮我..谢谢你

重写:希望能够监视控件中的文本,并在内容符合特定条件时模拟标签.

In a Button click event i want to invoke the "Tab" or "Space" automatically with out pressing tab or space from keyboard ..how can i achieve this task pls help me out..thank u

Rewrite: Want to be able to monitor text in a control, and simulate a tab when the contents match a particular criteria.

推荐答案

更清晰.也许您想要的是允许用户在某些信息完成后在其中输入文本,并将其输入到下一个控件中?那就是您要尝试的操作,然后可以使用KeyUp事件监视用户的击键(如果要停止输入,则可以监视KeyDown,然后取消KeyPress),完成后,在另一个控件上执行SetFocus .
As stated by others you need to be more clear. Maybe what you want is to allow the user to enter text in a when certain information is complete, more onto the next control? I that is what you are trying to do, then you can monitor the user keystrokes with the KeyUp event (if you want to stop input you would monitor the KeyDown and then cancel KeyPress), and when has completed, do a SetFocus on another control.


您可以监视文本更改事件:
You can monitor the text changed event: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.textchanged.aspx[^] and then use the textBox1.Focus() to put the focus on the next cell. You can also change the value of the textbox, but remember you may want to change the SelStart and SelLength which determine selected characters in the textbox.


这篇关于hii在按钮单击事件中,我想调用"Tab"标签.或“太空"手动地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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