列表框的SelectionItemPattern [英] SelectionItemPattern for a listbox
问题描述
我创建了一个带有标准.NET列表框的小型测试应用程序,其中包含4个项目.
I created a small test application with a standard .NET listbox on, it contains 4 items.
我实现了"selectedindexchanged"事件,以便它显示选择了哪个项目.
I implemented the 'selectedindexchanged' event so that it displays which item was selected.
当我手动选择时,它会显示所选的项目索引.
When I select manually, it displays the itemindex that was selected.
但是当我通过UISpy(SelectionItemPattern)选择时,它会选择该项目,但不会触发事件吗?所以没有事件被触发,我看不到选择了哪个项目?
But when I select via UISpy (SelectionItemPattern), then it selects the item, but it doesn't trigger the event? So no event is triggered and I don't see which item was selected?
关于如何解决此问题的任何想法?尽管它确实正确选择了项目本身,但它也无法通过代码工作.
Any idea on how to fix this? It also doesn't work via code, although it does select the item itself correctly.
谢谢
尼克
推荐答案
您是否已检查"SelectionPattern和SelectionItemPattern样本"?在 http://msdn2.microsoft.com/en-us/library/aa972140.aspx ?从您的描述看来,该示例可能与您遇到的问题有关.
Have you checked the "SelectionPattern and SelectionItemPattern Sample" at http://msdn2.microsoft.com/en-us/library/aa972140.aspx? From your description, it sounds like this sample may be relevant to the issues you are encountering.
这篇关于列表框的SelectionItemPattern的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!