AutoCompleteBox Dropdown width

只谈情不闲聊 提交于 2020-01-03 12:59:41

问题


Can the width of the dropdown be set to a different value than the AutoCompleteBox itself?


回答1:


The Popup is a separate Part of the AutoCompleteBox, so it should be possible to extend that beyond the width of the text box.

In Blend, right-click on the AutoCompleteBox and select Edit Template > Edit a Copy, giving the new template a name.

Drill-down in the Objects and Timeline window to the 'Popup' part, and beneath that is a Grid. Change the width of that Grid to change the width of the popup content whilst maintaining the current width of the text box).

(I must admit I've only had chance to do this in Silverlight Spy, but it definitely works there so I can't see it being a problem doing it through Blend).




回答2:


If you are not using Blend, just copy Default Style and Template of AutocompleteBox from MSDN and paste it into your App.xaml file (here is little tutorial on how to handle styles in app.xaml).

You can then modify that pasted style or template.



来源:https://stackoverflow.com/questions/5293297/autocompletebox-dropdown-width

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