A WPF component for displaying a list of elements in a horizontal or vertical stack.
Questions tagged [stackpanel]
629 questions
10
votes
5 answers
How to implement a click event for a stackpanel
I checked the stackpanel class here http://msdn.microsoft.com/en-us/library/system.windows.controls.stackpanel.aspx and it has no click event.
I'm working on a windows phone 8 app and I've got a textbox and some buttons on a stack panel. I want to…

Nii Laryea
- 1,211
- 5
- 18
- 31
9
votes
3 answers
Building a reversible StackPanel in WPF
I'd like to build a custom StackPanel with a ReverseOrder property that I can declaratively set to true to have the elements in the StackPanel appear in the opposite order of normal (e.g. bottom to top or right to left). It needs to be reversible on…

devios1
- 36,899
- 45
- 162
- 260
9
votes
3 answers
How to Fit WPF StackPanel to Grid Cell
I have a StackPanel control in my WPF project, and it is in column 0 row 2 of a Grid. How can I autofit the StackPanel size to the size of that grid cell? Setting the StackPanel width and height to "auto" will just size it to its contents. I could…

Connor Neville
- 7,291
- 4
- 28
- 44
9
votes
4 answers
WPF - How to get only one expander expanded at any one time
I've got a StackPanel with a group of expanders in, how do I set it so that only expander is expanded at any one time?
Cheers
AW

AwkwardCoder
- 24,893
- 27
- 82
- 152
9
votes
7 answers
WPF StackPanel with Click AND DoubleClick
I need to be able to handle the double click and single click event on the WPF StackPanel. But there is no such thing as the StackPanel's DoubleClick Event.
I want to do 2 different operations in these 2 EventHandlers.
Any idea how to do that?
Thank…

theSpyCry
- 12,073
- 28
- 96
- 152
8
votes
4 answers
8
votes
1 answer
WPF StackPanel PNG Capture not rendering correctly
I am attempting to create a png capture of a StackPanel, however when I save, I am getting a distorted view where all the content is black rectangles, and the size is not correct. The width and height are correct in the image save, however all the…

JeremyK
- 1,075
- 1
- 22
- 45
8
votes
2 answers
Horizontal Orientation in Stackpanel, new line at the end of Stackpanel width
Let's say that we have a Stackpanel with Horizontal Orientation and a width of 100px.
Inside it i make eleven square Canvas drawings width the size of 10px.
This means that the last square will be outside of view, because it will extend the…

Jonatan Grim
- 93
- 1
- 5
8
votes
4 answers
sorting elements in a stackpanel WPF
I have a stackpanel with some usercontrols that are added or removed during runtime.
These elements have an index that i assign to them when i new them, I need to keep these elements sorted by that index so i wote a quicksort function that sorts…

irco
- 961
- 6
- 13
- 27
8
votes
1 answer
How to stretch button all over the grid, xaml
I have a problem with stretching the button all over the grid.
My code look like this:
…

MNie
- 1,347
- 1
- 15
- 35
8
votes
1 answer
QT spacer equivalent in WPF
I have a StackPanel with some vertically alligned controls (stackpanel on the right in this picture:
The last control should always be placed at the bottom of the window inside of the border control (The OK button on the picture). In QT I'd insert…

alex
- 111
- 6
8
votes
2 answers
How to get the position of an element in a StackPanel?
Say I have a StackPanel that gets dynamically filled with copy, changing the Y position of elements inside it. I have a specific element within that StackPanel that I want to find the Y position of (relative to the StackPanel or otherwise) after the…

roblocop
- 356
- 1
- 4
- 14
8
votes
2 answers
Why won't the WPF progressbar stretch to fit?
This is my original code:

John NoCookies
- 1,041
- 3
- 17
- 28
8
votes
3 answers
WPF ToolBar Separator shrinks to nothing when inside a StackPanel
Given the very simple wpf app
…

kenwarner
- 28,650
- 28
- 130
- 173
8
votes
1 answer
Silverlight: Canvas overflows
I have created a Canvas, and within it I placed a StackPanel. The StackPanel is horizontal, and it accepts a list of thumbnailed images. The Canvas has a fixed size. When I put more thumbnails than the Canvas width can hold, the StackPanel is…

Palantir
- 23,820
- 10
- 76
- 86