Users Pricing

forum

Home Forums Disable the exit/close button in C# WPF. – MindStick

Disable the exit/close button in C# WPF.

Anonymous User 15198 19 Jul 2013

Is it possible to disable the close button in a WPF form? How can I disable the close button?

I have been searching around and found the solution below. But that works only in Windows Form!

private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
{
      e.Cancel = true;
}

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md