SoFunction
Updated on 2025-03-06

C# to implement WinForm prohibition on maximization, minimization, double-clicking the title bar, double-clicking the icon, etc.

C# to implement WinForm prohibition on maximization, minimization, double-clicking the title bar, double-clicking the icon, etc.

Updated: August 20, 2015 12:16:07 Author: My Heart Still
This article mainly introduces C# to implement the methods of maximizing, minimizing, double-clicking the title bar, double-clicking the icon and other operations in C#. It involves various common techniques for using WinForm for window operations. It has certain reference value. Friends who need it can refer to it.

This article describes how C# implements WinForm prohibition to maximize, minimize, double-click the title bar, double-click the icon and other operations. Share it for your reference. The specific implementation method is as follows:

protected override void WndProc(ref Message m)
{   
 if (==0x112)
 {
  switch ((int) )
  {
   //Don't double-click the title bar to close the form   case 0xF063:
   case 0xF093:
     = ;
    break;
   //Drag the title bar to restore the form   case 0xF012:
   case 0xF010:
     = ;
    break;
   //Don't double-click the title bar   case 0xf122:
     = ;
    break;
   //Disable close button   case 0xF060:
     = ;
    break;
   // Maximize buttons are prohibited   case 0xf020:
     = ;
    break;
   //Disable the minimization button   case 0xf030:
     = ;
    break;
   //Restore button prohibited   case 0xf120:
     = ;
    break;
   }
 }   
 (ref m);
}

I hope this article will be helpful to everyone's C# programming.

  • C#
  • WinForm

Related Articles

  • Detailed explanation of C# study notes for adapter mode

    This article mainly introduces the relevant information about the adapter mode of C# study notes, which has certain reference value. Interested friends can refer to it.
    2017-11-11
  • Detailed explanation of hiding and disabling window close button in C# winform

    This article mainly introduces the detailed explanation of the hiding and disabling of the window closing button in C# winform. It has good reference value and hopes it will be helpful to everyone. Let's take a look with the editor
    2020-12-12
  • Example code of the circular linked list of C# data structure

    The example code of the C# data structure loop linked list, if you need it, you can refer to it
    2013-03-03
  • C# Base keyword usage

    The usage example code for c# Base keywords can be used below.
    2009-07-07
  • C# randomly sets 900-1100 millisecond delay

    This article mainly introduces the method of randomly setting 900-1100 millisecond delay in C#, which involves the skills of using methods in C#. Friends who need it can refer to it.
    2015-04-04
  • Methods for array initialization and array element copying in C#

    This article mainly introduces the methods of array initialization and array element copying in C#, which involves the skills of creating, initializing and using arrays in C# to copy array elements. Friends who need it can refer to it
    2015-04-04
  • C# protobuf automatically updates cs file

    This article mainly introduces the relevant information of C# protobuf automatically updating cs files. It is very good and has certain reference value. Friends who need it can refer to it.
    2020-02-02
  • C# to determine the format of graphics file

    This article mainly introduces the method of C# to determine the format of graphics file, including common extension judgments and file content judgments. It is very practical. Friends who need it can refer to it.
    2014-09-09
  • C# Simple example of creating, deploying, and calling WebService

    This article mainly introduces a detailed introduction to C# simple examples of creating, deploying and calling WebService in C#. It has certain reference value. Interested friends can refer to it.
    2017-05-05
  • Detailed explanation of the method example of C# synchronizing network time

    This article mainly introduces the method of C# synchronizing network time, and analyzes the relevant skills of C# to obtain network time and synchronize the local system time in a more detailed manner in the form of an example. It is very practical. Friends who need it can refer to it.
    2015-05-05

Latest Comments