Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to align labels or textboxes at a time in wpf
.
As we select more than one controls and align in winforms
why we cant do in wpf
, here align tool bar is always disabled...
Posted
Updated 20-Sep-14 1:14am
v2
Comments
[no name] 20-Sep-14 7:23am    
That is because you are expected to use an appropriate container for your controls. WPF != Winforms.
Sergey Alexandrovich Kryukov 20-Sep-14 12:41pm    
The problem is different: OP used to manual layout using the designer, a big habit. WPF, which naturally resist such things, is easier for keeping proper alignment and harder to screw up. I put some answer as Solution 1.
—SA
Madhuri Gamane 20-Sep-14 7:35am    
and what is that ?
[no name] 20-Sep-14 9:21am    
What is what? WPF? Winforms? Controls? A control container? Since you already know what a control container is, I can't imagine why you would ask that or even ask the question to begin with.

1 solution

The question does not really make sense. In WPF, everything is aligned by definition. If you resize a window, alignment is not broken, unless you screw it up in some way. (As you did not show any code samples, I don't know how.) In this respect, WPF is more stable than Forms, where many people use ad-hoc explicit positioning of control (a big no-no).

For understanding WPF layout, please read:
http://msdn.microsoft.com/en-us/library/ms745058%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms754152%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/bb514628%28v=vs.90%29.aspx[^],
http://www.wpftutorial.net/LayoutProperties.html[^].

Good luck,
—SA
 
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