WinForm form Cancel maximized double-click Title Maximization

Source: Internet
Author: User

To achieve a goal, fix the form size,
1. Remove the Maximize button from the form title
2. Double-click on the form title will not maximize, completely cancel maximize

Problem, if you set the form MaximizeBox and MinimumSize properties, it seems that the problem solved, the problem is that the single-click on the form title, although the size is not changed, the form position jumps to the upper left corner,

Solution One:

1 Private voidFrmfixesize_load (Objectsender, EventArgs e)2        {3            //Method One4             This. MaximizeBox =false;5             This. MinimumSize = This. MaximumSize = This. Size;6             This. FormBorderStyle =FormBorderStyle.FixedSingle;7}



Solution Two: (still need to set up MaximizeBox=false the form),

protected Override void WndProc (ref  Message m)       {           // method Two           if0xa3  )           {               return;           }            base. WndProc (ref  m);       }


This example source code download: Http://pan.baidu.com/s/1mgKEaXM Password: LFJF

WinForm form Cancel maximized double-click Title Maximization

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.