The properties of the form and control CreateParams ( which is really a property ) are magical, because it makes it easy for you to control some of the features of a form or control such as a border, the ability to minimize the hide of the Close button, the modal popup mode of the form, and so on. Although the createparams has such great potential, it is very discreet when used, and if you do not understand the CreateParams attribute, you will be very confused when writing other code.
Refer to the description of CreateParams in MSDN:
do not override this property in the overloaded control you are developing, and control some of the style of the control with this property. Use this property only if you are encapsulating Windows controls or want to implement some style (such as layered Window) control that some WinForm do not provide. For more information, refer to the documentation comments on MSDN for the CreateWindow method and the parameters of the CreateWindowEx method createstruct structure.
Briefly explain why CreateParams can achieve such advanced style control, since the names of CreateWindow and CreateWindowEx show that Createparam is a parameter passed to both methods, These two methods are also called when the form is created. So, Createparam can achieve such a powerful style control.
In the process of developing winform in net, we sometimes need to make some special settings for form forms, such as:
Hide the main form, showing only the taskbar icon in the lower-right corner
The "Hide main form" Above has several implementations, but the most perfect and thorough method is to override the CreateParams event of the base class form.
Override createparams CreateParams { get { falsebase. CreateParams; } }
The above code is the implementation, very simple and effective, debugging run, do not see a form (because the form's visible visual property is set to False, that is, the form is not visible). However, the form's event Form_Load, Form_shown, form_paint, etc. are still available.
Reprint: http://www.cnblogs.com/JuneZhang/archive/2012/07/06/2579058.html
C # WinForm uses the override CreateParams to override some of the form's features