A WPF component for displaying a list of elements in a horizontal or vertical stack.
Questions tagged [stackpanel]
629 questions
24
votes
2 answers
What is the difference between a stackpanel and a virtualizingstackpanel in WPF?
What is the difference between a stackpanel and a virtualizingstackpanel in WPF?

Peter
- 37,042
- 39
- 142
- 198
24
votes
7 answers
How can I make elements arranged in a horizontal StackPanel share a common baseline for their text content?
Here's a trivial example of the problem I'm having:
Bar
Baz
Bat
…

Robert Rossney
- 94,622
- 24
- 146
- 218
24
votes
2 answers
WPF Databinding stackpanel
Im a beginner in WPF programming, coming from .NET 2.0 C#.
Im trying to make a horizontal StackPanel which should be filled with data from a table in a database. The problem is that I want it to display an image with some text from the table below…
Kaare
23
votes
3 answers
WPF - How to right align a textblock inside a horizontally oriented stackpanel?
This should be so simple - I've been hitting my head against my desk for so long trying to make a seemlingly simple task work (makes me feel like WPF is un-intuitive or buggy)...
In any case, I've got a Stackpanel which is set to horizontal…

bugfixr
- 7,997
- 18
- 91
- 144
22
votes
1 answer
How to enable text wrapping in CheckBox
How I can wrap text in CheckBox? The text is a bit longer than width of page, but I cannot shorten it. CheckBox doesnt have TextWrapping attribute. ;(
Also I tried to set Width="460", Width="*", but I didnt succeed.

sangeek
- 223
- 1
- 2
- 4
21
votes
5 answers
What is the easy way to set spacing between items in StackPanel?
Is there an easy way to set default space between items inside StackPanel so I'll don't have to set Margin property on each item?

Poma
- 8,174
- 18
- 82
- 144
20
votes
2 answers
How do I align side by side in stackpanel?
How can I have the button align beside the ComboBox ? I am not able to drag the button to the side of the ComboBox using designer.
…

Alvin
- 8,219
- 25
- 96
- 177
18
votes
2 answers
Changing Visibility in a StackPanel
I have a WPF StackPanel that looks like this:
(some attributes removed that don't matter)

abelenky
- 63,815
- 23
- 109
- 159
18
votes
2 answers
How to disable tab stop on a stackpanel
I have a stackpanel that keeps getting focus when I tab around in the application.
Using snoop I can see that the stackpanel has a ContentControl which has a ContentPresenter. It is the ContentControl that gets the focus. How can I disable this?…

Michael
- 1,081
- 1
- 12
- 27
17
votes
7 answers
WPF Grid vs Stackpanel
For WPF/Silverlight layout, is it better to use a Grid with lots of rows and columns, or tons of Stackpanels?

NotDan
- 31,709
- 36
- 116
- 156
17
votes
2 answers
Defining DataTrigger for StackPanel
How do I define a DataTrigger for a StackPanel? It does have a Trigger property, but defining a trigger here gives the following error on Initialize when starting the application:
Failed object initialization (ISupportInitialize.EndInit).…

stiank81
- 25,418
- 43
- 131
- 202
17
votes
2 answers
WrapPanel not wrapping when in a StackPanel with Horizontal orientation
The labels in the example below (WPF/XAML) just parade off the screen, no wrapping occurs. Removing the orientation works, but doesn't provided the needed functionality/look & feel. Any ideas how to make the WrapPanel wrap to the current size of…

derGral
- 1,836
- 4
- 19
- 29
16
votes
3 answers
C# Flow Layout Panel Line break or New line
I am adding some controls to Flow layout panel. In between some controls I need a line break.
How can I achieve this please.
Thanks

dps123
- 1,033
- 6
- 19
- 26
15
votes
3 answers
WPF - setting HorizontalAlignment= Stretch to Textbox in StackPanel
Why doesn't a textbox stretch to fill space in a stackpanel? Is this by design? In a grid, the textbox stretches as expected.

Malcolm
- 12,524
- 28
- 89
- 125
15
votes
2 answers
Hide TabControl buttons to manage stacked Panel controls
I need to handle multiple panels, containing variuous data masks. Each panel shall be visible using a TreeView control.
At this time, I handle the panels visibility manually, by making the selected one visible and bring it on top.
Actually this is…

Luca
- 11,646
- 11
- 70
- 125