如何滚动到选定的项目列表框中中的Windows Phone 7 [英] How to Scroll into selected item in listbox in windows phone 7
本文介绍了如何滚动到选定的项目列表框中中的Windows Phone 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要滚动到所选的项目在列表框中。对于在 Listbox1_SelectionChanged
事件的代码,我现在用的一条线,但滚动不工作。我试着在点击一个按钮即是工作的罚款一样的。
Listbox1.ScrollIntoView(Listbox1.Items [Listbox1.SelectedIndex]) ;
解决方案
我在我的解决方案首先更新UI使用和被叫ScrollIntoView它工作正常:
Listbox1.UpdateLayout();
Listbox1.ScrollIntoView(Listbox1.Items [Listbox1.SelectedIndex]);
I want to scroll into selected item in a list box .for that now I am using one line of code in Listbox1_SelectionChanged
event, but scroll is not working. I tried the same in a button click that is working fine .
Listbox1.ScrollIntoView(Listbox1.Items[Listbox1.SelectedIndex]);
解决方案
I used in my solution first updated UI and the called ScrollIntoView it works fine:
follow this link for more info
Listbox1.UpdateLayout();
Listbox1.ScrollIntoView(Listbox1.Items[Listbox1.SelectedIndex]);
这篇关于如何滚动到选定的项目列表框中中的Windows Phone 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文