StackPanel In xaml?
What the use of StackPanel In Xaml?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Oct 7, 2012, 9:20 PM EDT
You can ask instead of stack panel, we can use dock panel.
But the difference is the order that you place child elements can affect the size of child elements in a DockPanel but not in a StackPanel. So you will get scollbar in stackpanel, but in Dockpanel, it will try to limit the area occupied by child control.
siri sri2 reputationPosted Oct 10, 2012, 2:33 PM EDT
Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Oct 21, 2012, 7:32 AM EDT
stack panel is useful xaml layout ,it's keep control horizontal and vertical . we Normally use when we need application as like bunch of control layout or list of control layout.
Stack child element horizontally or vertically
Default is vertical .
Use orientation properties to change to horizontal .
Control positioning of element by setting their horizontal Alignment or vertical Alignment Properties.
Control spacing by setting margin and padding properties of element .
Stretched to fill stack panel if Horizontal Alignment or Vertical Alignment is set to stretch.
Below simple Xaml code for stack Panel
FontWeight="Bold">List of fruits
StackPanel Orientation Properties Simple Xaml