Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Suppress form maximization on title double-click

Posted on 2010-11-18
Last Modified: 2012-06-21
I'm using c# 4.0. I have a form that has a title bar. I want to suppress the ability to maximize the form by double clicking it.

I've tried

private void Form1_Load(object sender, EventArgs e) {
this.SetStyle(ControlStyles.StandardDoubleClick, false);

Open in new window

but that doesn't do it. I've tried trapping the click event but don't know how to suppress it.

Question by:BlearyEye
LVL 28

Expert Comment

ID: 34168152
Do you allow resizing of the window? If not, make sure you specify the max window size. If you do allow resizing, I don't think this can be changed.
LVL 85

Accepted Solution

Mike Tomlinson earned 500 total points
ID: 34168304
Like this?

public partial class Form1 : Form
        public Form1()

        const int HTCAPTION = 0x2;
        const int WM_NCLBUTTONDBLCLK = 0xA3;

        protected override void WndProc(ref Message m)
            switch (m.Msg)
                case WM_NCLBUTTONDBLCLK:
                    if (m.WParam.ToInt32() == HTCAPTION)
            base.WndProc(ref m);


Open in new window


Author Closing Comment

ID: 34168976
Perfect, thanksl

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Media.Imaging 1 23
Finally almost got it 5 48
transaction in asp.net, sql server 6 43
Dynamics CRM Plugin Query TotalRecordCount returning -1 13 42
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question