Click here to Skip to main content
15,919,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

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
 
Share this answer
 
v2
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?
 
Share this answer
 
Comments
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.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900