简体   繁体   English

如何将ListBox项扩展到侧面?

[英]How can I expand a ListBox item to the side?

I have a ListBox which contain text and image. 我有一个包含文本和图像的列表框。 When the user click on an Item I want that it will expand to the side and will show some more information. 当用户单击某个项目时,我希望它会扩展到侧面并显示更多信息。 I have tried to do it with Expander control, but it's does'nt expand over the ListBox border. 我试图用Expander控件来做到这一点,但是它并没有扩展到ListBox边框上。 Does anyone have any suggestions ? 有没有人有什么建议 ?

This sounds like a classic master/detail type of user interface - the ListBox is the master, and you want some detail to show once the user selects an item. 这听起来像是经典的主界面/详细信息类型的用户界面-ListBox是主界面,您希望在用户选择项目后显示一些细节。

If the tooltip suggestion from Notter is not suitable, then i would suggest that you have your expander control beside the ListBox, not inside of it. 如果来自Notter的工具提示建议不合适,那么我建议您将扩展器控件放在ListBox旁边,而不是在其中。 There are already a multitude of posts here on SO deailing with this (usually using the DataGrid as the master, but the concept is the same), check out this search and see if anything is helpful. 在SO上已经有很多帖子对此有所介绍(通常使用DataGrid作为主控件,但是概念是相同的), 请检查此搜索并查看是否有帮助。

除此之外,您可能还可以使用Popup / tooltip控件(忘了它的名称),我想不出能满足您要求的任何东西,但是我很确定您会做的任何事情都不会与ListBox本身有关,但与DataTemplate有关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM