Do not drag the title bar. Double-click the title bar to make it unresponsive.

Source: Internet
Author: User
1 Using System;
2 Using System. Windows. forms;
3
4 Public   Class Test: Form
5 {
6 Test ()
7 {
8 Text =   " Do not drag the title bar. Double-click the title bar to make it unresponsive. " ;
9 Formborderstyle = Formborderstyle. fixeddialog;
10 Maximizebox =   False ;
11 Minimizebox =   False ;
12 }
13
14 Protected   Override   Void Wndproc ( Ref Message m)
15 {
16 Base . Wndproc ( Ref M );
17 If (M. msg =   0x84   && M. Result = (Intptr) 2 ) // Do not drag the title bar
18 {
19M. Result=(Intptr)1;
20}
21 If (M. msg =   0xa3 ) // No response is returned when you double-click the title bar.
22 {
23M. wparam=System. intptr. zero;
24}
25 }
26
27 Static   Void Main ()
28 {
29Application. Run (NewTest ());
30}
31 }

From the perspective of the csdn forum, it is a pity that you can also right-click on the title bar to move the window. It should also be forbidden, but I am not familiar with wndproc and do not know how to implement it.

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.