Click here to Skip to main content
12,560,367 members (49,346 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
I have a form which I've removed the minimize and maximize buttons from, set the FormBorderStyle to none, added drag & drop behaviour, but I want my form size to be static. Now form maximizes/minimizes on Double Click. I've kept same max ,min size same. Then my form moves on double click. How can I stop it?
Posted 23-Feb-13 18:25pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

As you can see by the comments to Solution 1, both OriginalGriff and myself were able to reproduce the behavior you describe by setting the ControlBox property to False, while keeping the MaximizeBox and MinimizeBox properties True.

If that is what you have done, all you have to change is set the MaximizeBox and MinimizeBox properties to False.

Soren Madsen
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have set the MaximizeBox and MinimizeBox properties to false, then double click in the title bar should no longer work - certainly it doesn't for me.
So what are you doing that I am not?
SoMad 24-Feb-13 4:18am
It is possible he removed the Maximize and Minimize buttons by setting ControlBox to False, while keeping MaximizeBox and MinimizeBox True.

Soren Madsen
OriginalGriff 24-Feb-13 4:21am
That'd probably do it.
Just checked - yep! double click maximises if MaximizeBox is true but ControlBox is false. Lazy MS programmers! :laugh:
SoMad 24-Feb-13 4:29am
Yes. Sorry, I cheated. I checked it out before I posted my comment :).

I was surprised it worked that way, but then again, that gives you extra flexibility in case you want that behavior.

Soren Madsen
OriginalGriff 24-Feb-13 4:38am
Cheat away - I would probably have checked before I posted something like that as well.
Post it as a solution - it will probably solve his problem if he doesn't read these comments.
SoMad 24-Feb-13 4:56am
Done. Thanks.
OriginalGriff 24-Feb-13 5:07am
And voted!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161026.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100