WPF: Listbox, centering selected item

爱⌒轻易说出口 提交于 2019-12-01 20:33:12

David Anson posted some articles on his blog that might help you here: Part 1 and Part 2. He gives an extension method that centers an item in an List Box. You might be able to build on that.

It is possible with couple of lines of custom code. Here's a discussion of a sample implementation. You might need to tweak it a bit to account for even number of items, insted of only odd number, but the general idea is the same.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!