如何仅使用箭头键选择组合框的项目?(Silverlight) [英] How to select combobox's items using just arrows keys?(Silverlight)

查看:174
本文介绍了如何仅使用箭头键选择组合框的项目?(Silverlight)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有用于字体类型和简单按钮的组合框.如果单击按钮,焦点将设置为组合框并打开它,如下所示:

In my project I have combobox for font types and simple button. If the button clicked the focus is set to the combobox and open it, like this :

private void button_Click(object sender, EventArgs e)
       {
                      Mycombobox.Focus();
                      Mycombobox.IsDropDownOpen = true;

       }



打开组合框后,用户开始使用箭头导航项目,然后单击Enter选择想要的字体类型以将其应用于所选文本.

我的愿望是改为使用默认的Enter键或鼠标来选择要应用于突出显示的文本的字体,我想直接使用箭头键进行导航和同时选择,例如,突出显示一些文本然后打开组合框,我使用箭头键(向上和向下)来导航组合框的各项(字体类型:Arial,Verdana ..),并且在导航时,我看到更改立即应用于了我不需要的突出显示的文本上按Enter或鼠标以查看已应用的更改.
我该怎么做?任何帮助请
(对不起我的英语!)



After the combobox is opened, the user start navigate the items using arrows and click Enter to select the wanted font type to apply it on selected text.

My wish is instead using the default Enter key or mouse to select the font to be applyed on highlighted text, I want directly use the arrows keys for both navigation and same time selection, for example, I highlighted some text then i open the combobox and I use the arrows keys (up and down) to navigate the items of the combobox ( fonts types: Arial, Verdana..)and while I''m navigating I see the changes applyed immediatly on the highlighted text I don''t need to press Enter or mouse to see changes been applyed.
How I can do that? any help please
(sorry for my English!)

推荐答案

看看
Have a look at this post.

Once you have implemented an event for key stroke, you can write logic to refresh your UI based on this stroke.


这篇关于如何仅使用箭头键选择组合框的项目?(Silverlight)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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