Solved

Disable double click on title bar of windows form

Posted on 2016-08-17
3
28 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 143

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

832 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