Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to add resize drop down in form status bar. And how to set value on selected index of drop down for resize the form size. Ex 150%, 100%, 80%, 60%.
Posted
Updated 19-May-11 7:50am
v6
Comments
Sergey Alexandrovich Kryukov 19-May-11 11:57am    
Tag it! WPF, Forms, what?!
Why it seems to be a problem?
--SA
divesh12 19-May-11 12:13pm    
WPF
Orcun Iyigun 19-May-11 13:47pm    
Updated the tags.
divesh12 19-May-11 13:50pm    
winforms
Pete O'Hanlon 19-May-11 15:59pm    
So not WPF then. No point posting a WPF sample then.

This isn't as simple as it sounds because of a tiny little wrinkle in the logic potential. First of all, what's the basis of the resizing size. In other words, what size are you going to use as the starting point for the resize? Obviously you can't just keep resizing relative to the current size because the effects would be cumulative.

Theoretically, I would do this by creating a ValueConverter for the height and width of the form. In that converter, I would have the basic dimensions of the form. Then I would use the selection changed in the combo to actually trigger that size change. This way, you can maintain the binding entirely virtually entirely through your XAML.
 
Share this answer
 
Comments
divesh12 19-May-11 13:20pm    
Thanks but Please show me any demo for this or if you have any link for that.
In your selection changed handler, multiply the DesiredSize property of the element by the selected percentage.
 
Share this answer
 

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