Click here to Skip to main content
15,939,960 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

My Name is Phani Kumar. I am developing a WPF application. I specified size of the height and width as 600 x 600. In the runtime when, I maximize it the controls on the window screen are scattered and are aligned in irregular manner. can anyone help to run application in maximized and minimized?
Posted
Updated 2-Aug-10 8:22am
v2

Firstly, accept my apologies, this will not be a full answer.

The way a window works in WPF is quite different to that of standard MDI/Winforms applications. If you don't specify the size of the window, it will fit to its contents for example.

Similarly the controls re-size to their containers, dependant upon on the container type. Most probably you will need some kind of DockPanel somewhere.

What you need to do is find a book or online resource to get to grips with WPF layout (especially the different containers) as it is very different from WinForms (and much more powerful). I'm sorry I can't be more helpful than this. This really isn't a "you haven't researched this properly" type reply, I genuinely cannot add more without seeing you application and how you want things to display.
 
Share this answer
 
Your Margin, HorizontalAlignment, and VerticalAlignment properties are all whacked out. Part of the problem with VS2008 is that when uyou move stuff around in the designer, it CHANGES those properties for based on what it THINKS you want to do. I don't know if VS2010 still does this, but I wouldn't be surprised if it did.

You have to go back and MANUALLY set them to the desired values, and then remember not to move things around with the mouse in the designer. I know, it's a pain in the a*s, but such is the burden we bear.
 
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