Override WndProc in your form, listen for minimum message details, and cancel.
Add this code to the form:
private const int WM_SYSCOMMAND = 0x0112; private const int SC_MINIMIZE = 0xf020; protected override void WndProc(ref Message m) { if (m.Msg == WM_SYSCOMMAND) { if (m.WParam.ToInt32() == SC_MINIMIZE) { m.Result = IntPtr.Zero; return; } } base.WndProc(ref m); }
I changed Rob code found in this SO thread:
How to disable the minimize button in C #?
Works great: no flickering, there is nothing when a user tries to minimize it.
source share