Solved

Disable double click on title bar of windows form

Posted on 2016-08-17
3
26 Views
Last Modified: 2016-08-18
Hello,
How can i disable  double click on title bar of windows form which resizes it to normal.


Cheers
0
Comment
Question by:RIAS
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41759165
you can set the FormBorderStyle to one of the Fixed values:
FixedSingle
Fixed3D
FixedDialog
FixedToolBar

however, this will also block the resizing as such of the form
you may also set
MaximumSize (and MinimumSize)
to still keep resizing, but not allowing the form to maximise

hope this helps
0
 
LVL 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 41759341
If the suggestions from Guy do not suffice, you can also override the windows message processing loop -
Public Class Form1
	Const WM_NCLBUTTONDBLCLK As Integer = &HA3

	Protected Overrides Sub WndProc(ByRef m As Message)
		If m.Msg = WM_NCLBUTTONDBLCLK Then
			m.Result = IntPtr.Zero
			Return
		End If
		MyBase.WndProc(m)
	End Sub
End Class

Open in new window


-saige-
0
 

Author Comment

by:RIAS
ID: 41761223
Thanks Experts!
Thank you Saige Sir!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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