My blog about application development on the .NET platform and Windows®.

Disabling or hiding the minimize, maximize or close button of a WPF window

There may be situations when you want to hide or disable the minimize, maximize, or close button of a window without having to modify the style of the window in any other way. In a Windows Forms application there are the MinimizeBox and MaximizeBox boolean properties that lets you disable the minimize and maximize button of a Form respecively or hide them both (setting both of these properties to false will effectively hide both these buttons):

public partial class Form1 : Form
{
  public Form1() {
    InitializeComponent();

    this.MinimizeBox = false;
    this.MaximizeBox = false;
  }
}

Read ┬╗

Advertisements