Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I set my application to be able to "snap" on a windows 7 machine? I am coding in C# using Visual Studio 2008 (but could be ready to move up to 2010 if needed).
Posted
Updated 28-Jun-10 3:55am
v3

A WinForms application written in c# (VS2008) will snap without any extra code provided you allow min/max/restore (the default) on the window.

So, you don't have to do anything!

Cheers.
 
Share this answer
 
Hmmm... my program does the regular min/max/restore, but it won't snap. You can drag it over there and it acts like it is going to and then doesn't.
Could it be that I have a set size it can't get smaller than?
I allow it to grow and the side of the screen is larger than the small size.
 
Share this answer
 
Comments
TheyCallMeMrJames 28-Jun-10 12:12pm    
If you're doing any custom sizing or responding to size events on your own it's possible that you are interrupting the process, but a custom size should not. From the designer, I just set up a form at 175x400 and it snaps fine. Cheers.
DaveyM69 28-Jun-10 16:28pm    
For future reference, you should have posted this as a comment to the answer provided. Add Answer is for answers only, Submit Comment is for comments and further discussion.

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