Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello guy

in GADGETS menu you see a expander for a show/Hide Details.and when click show details form resize slowly with animate and when i click hide expander again Form resize to first size.

see in gadgets. i need help and example source code
Posted
Updated 10-Jan-14 23:05pm
v2

You can use Control.Dock Property[^] and Control.Anchor Property[^] to manage minimizing, maximizing as well as re sizing your control.

Take a look there How to: Resize Windows Forms[^] to learn how to code to resize the form.
 
Share this answer
 
Use a Timer: 1/10th second, or maybe 1/20th should do.
Have a class level Target value, and a Delta. Set them before you start the timer.
If the timer Tick event, check the delta: if it's positive, you want to move down, negative move up. Zero, stop the timer.
Add the delta to the Height, and check against the target: If you aren't there yet (which depends on the up / down from above, remember to allow for overshoot and don't use ==, you need <= or >=) then set the new value into the Form Height.
If you are done, then set the Form Height to the Target height, zero the Delta, and stop the timer.
 
Share this answer
 
im new in c sharp :( can you make a project ?

I use WPF application..
 
Share this answer
 
v2

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