Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable double click on title bar of windows form

Posted on 2016-08-17
3
Medium Priority
?
51 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 35

Accepted Solution

by:
it_saige earned 2000 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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

916 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