在Silverlight的Popup的列表框中设置焦点 [英] Set focus in Popup's Listbox in Silverlight

查看:68
本文介绍了在Silverlight的Popup的列表框中设置焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在Silverlight中工作.在我的Silverlight应用程序中,有一个文本框和一个带列表框的弹出窗口.
当我在文本框"中写入任何文本时,我的弹出窗口是打开的,但是当我想在列表框项中设置焦点时,当我按下向下箭头键"时,我想扩展另一件事.我也尝试了很多事情,但仍然没有任何解决方案.

我也尝试这个

Hi All,

I am working in Silverlight. In my Silverlight Application there is One Textbox and One Popup with Listbox.
When i Write any text in Textbox then my popup is open But i want to extend one more thing when i press Down Arrow Key that time i want to set focus in listbox item. I have also try many thing and still i not getting any solution.

I also try this

int selectedIndex = lstRoot.SelectedIndex;
lstRoot.SelectedIndex = 0;
lstRoot.Focus();
lstRoot.SelectedIndex = selectedIndex;



在lstRoot中仍未设置焦点.

请帮助我....!!



Still focus is not set in lstRoot.

Please help me....!!

推荐答案

使用ScrollViewer滚动项目,并在弹出窗口中添加用于显示项目的列表框,您可以轻松地将焦点设置在列表框上物品.例如
Use ScrollViewer for scrolling Item and In Popup add Listbox for display items and you can easily set focus on listbox''s item. for eg.

lstRoot.Focus();





It through set focus on current scrolled item and easily up and down in listbox item.


这篇关于在Silverlight的Popup的列表框中设置焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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