WPF:如何删除菜单弹出框 [英] WPF: How to remove menu popup border

查看:15
本文介绍了WPF:如何删除菜单弹出框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除菜单的弹出边框.不是

我很抱歉重复了这个问题.我认为该属性与Menu"相关联,但该属性仍与MenuItem"相关联.将弹出窗口边框的Padding"和BorderThickness"更改为 0 解决了我的问题.

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.

解决方案

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.

这篇关于WPF:如何删除菜单弹出框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆