发送密钥代码以执行控件时出错 [英] error in sending keycode for execution to a control

查看:63
本文介绍了发送密钥代码以执行控件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试复制Visual Studio 2008的智能感知器。我有一个大文本框,所谓的textBox1和一个名为comboBox1的组合框。我希望当我按下文本框中的空格时,组合框必须出现,当我按任意箭头键时,必须使用它们来迭代组合框的选定项目,而不是在文本框的行中上下移动光标。但是当组合框不可见时,它们必须被用来在文本框中上下移动。



我怎么能这样做才能有人帮助我?

谢谢,

Akkywadhwa

Hi everyone,
I am trying to copy the intellisense of Visual Studio 2008. I have a big text box so called "textBox1" and a comboBox named as "comboBox1". I want that when i press space in my textbox the combobox must appear and when i press any of the arrow keys they must be utilized to iterate the selected items of combobox not for moving cursor up and down in lines of text box. But when combobox is not visible then they must be utilized to move up and down in lines of textbox.

How can i do so can anyone help me?
Thanks,
Akkywadhwa

推荐答案

这是Windows Forms,你可以利用例如 KeyDown [ ^ ]事件以实现所需的功能。



通过使用事件参数的Handled属性,您可以选择是否让导航键在文本框的行上移动。
Taken this is Windows Forms, you could utilize for exampleKeyDown[^] event to implement desired functionality.

By using the Handled property of the event arguments, you can choose whether to let navigation keys to move on the lines of the textbox or not.


这篇关于发送密钥代码以执行控件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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