WPF: How to remove menu popup border

半腔热情 提交于 2019-12-25 04:34:35

问题


I want to remove menu's popup border. Not the menu items's border as explained in this post.

This is a pic of my menu popup and I want to remove the white border the popup has.

I am using mahapps library for my main windows with basedark theme. Also please be patient with me, as I am new to WPF and XAML.

Here are all the things I have tried-

  1. Overwrote the border thickness and border brush of all the "menu items" with my custom style. This did not help as the border which I am interested is not tied to menuItems.
  2. Overwrote the border thickness and border brush property of the "menu" element. This just changes the menu element when the mouse is not over it. Hope that made sense.

I need the element/control trigger/content-presenter the menu element possesses to disappear the menu popup border. Hope someone can help me in this regard.


回答1:


My question was similar to the one asked here - Removing thin border around the menuitems

I apologize for duplicating the question. I was of the thinking the property was tied to "Menu" but the property is still tied to "MenuItem". Changing the "Padding" and "BorderThickness" to 0 of the popup's border solved my issue.



来源:https://stackoverflow.com/questions/36459286/wpf-how-to-remove-menu-popup-border

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