Click here to Skip to main content
11,648,785 members (82,901 online)
Rate this: bad
good
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
good
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
  Permalink  
v2
Rate this: bad
good
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?
  Permalink  
Comments
SoMad at 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 at 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 at 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 at 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 at 24-Feb-13 4:56am
   
Done. Thanks.
OriginalGriff at 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
0 F-ES Sitecore 400
1 OriginalGriff 369
2 CPallini 340
3 DamithSL 295
4 Kornfeld Eliyahu Peter 245
0 OriginalGriff 1,512
1 Sergey Alexandrovich Kryukov 1,022
2 jyo.net 994
3 DamithSL 986
4 CPallini 945


Advertise | Privacy | Mobile
Web04 | 2.8.150804.4 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2015
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