Hiding close button in RibbonWindow

Ribbon for WPF Forum

Posted 10 years ago by Reed Copsey
Version: 14.1.0601

How can we hide (or disable) the Close Button in a RibbonWindow?

The minimize/maximize buttons are handled via properties, but I don't see a way to disable or hide the close button.

Comments (3)

Posted 10 years ago by Reed Copsey

Note that I've even tried installing a Windows hook to disable the close button by name and position (using PInvoke of EnableMenuItem), but it appears this is overridden internally.  The same code works fine on a normal Window instance.

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Reed,

Something like this should work:

var chrome = WindowChrome.GetChrome(this);
if (chrome != null)
	chrome.HasCloseButton = false;

Actipro Software Support

Posted 10 years ago by Reed Copsey

Thanks - that seems to do the trick.

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.