Questions tagged [stackpanel]

A WPF component for displaying a list of elements in a horizontal or vertical stack.

629 questions
7
votes
1 answer

Smooth scroll within stackpanel in wpf

This is the code for the stackpanel which is filled in runtime…
Sergey
  • 11,548
  • 24
  • 76
  • 113
7
votes
2 answers

Set StackPanel background to WP7 selected accent (theme) color

I am wondering if it is possible to set the background of my StackPanel to the Windows Phone 7 user selected accent (theme) color. I have heard that you are supposed to use styles so it can be used for all the StackPanels on the current xaml page.…
Marko
  • 311
  • 3
  • 10
7
votes
2 answers

How to set Background in StackPanel

Please anyone let me know how to set image in stack panel background in xaml ? I have already tried the following it throwing an error that Background does not have property Image
Thorin Oakenshield
  • 14,232
  • 33
  • 106
  • 146
7
votes
1 answer

WPF: Spacing between elements in stackpanel

I have a stackpanel with checkboxes. I cant seem to make same spacing between checkboxes with margin property Can some1 tell me what am i doing wrong? The code below gives me this: (source: shrani.si) As you can see, the spacing between elements…
no9
  • 6,424
  • 25
  • 76
  • 115
7
votes
1 answer

Is there a way to change the draw order in WPF

Is there a way to change the draw order of Controls in a StackPanel without changing the actual ordering of these controls in the StackPanel? The reason I ask is that we have a button bar with margin 0 between the buttons. The active button grows…
Wouter
  • 2,170
  • 1
  • 28
  • 58
7
votes
1 answer

WPF StackPanel vertical Frame full height

I need to fill empty space with last element in stackpanel (Frame):
Nikalaj
  • 145
  • 2
  • 2
  • 6
7
votes
2 answers

Give equal width to controls inside a Stack Panel

I need to have two RadCharts inside a horizontal StackPanel and want both the charts to be of equal width. I don't want to give explicit length to the width of the charts. This can be easily achieved by using a Grid control but my scenario requires…
Merin Nakarmi
  • 3,148
  • 3
  • 35
  • 42
7
votes
2 answers

How to loop through WPF StackPanel static Items?

Probably very easy but I am having trouble to figure this out (also Google doesn't seem to help much). How can I loop through the statically declared elements (no databinding - elements are declared in the xaml) of a StackPanel? Any help…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
6
votes
1 answer

VirtualizingStackPanel Is not working

I have the following ListBox:
Gili
  • 151
  • 2
  • 5
6
votes
4 answers

How do I get stackpanel to resize to fit the controls it's stacking?

I'm making a toolbar. I want the width of the window to equal the total width of the buttons. StackPanel seems perfect for the job because it lines everything up, but it won't stretch.
Alan Baljeu
  • 2,383
  • 4
  • 25
  • 40
6
votes
1 answer

VirtualizingPanel in DataGrid

I've started exploring the Data and UI virtualization features in WPF recently and stumbled upon something strange. I created a DataGrid's with Virtualizing enabled and filled it with a list with 1,000,000 items. This works great and amazingly…
Omri Btian
  • 6,499
  • 4
  • 39
  • 65
6
votes
4 answers

How to expand a Slider to fill the available space when the slider is within a StackPanel

Inserting a Slider in a Grid would expand it to fill the available space, but I would prefer not use a grid for the following reason: I've a TextBlock and a Slider in a UserControl, the slider is spring loaded and does jog / shuttle; the current…
slide
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

how to align one component to left and other to right in stack panel in windows phone 8

I want to arrange two components, one to left and the other to right in stack panel which is horizontally aligned in windows phone 8. I need left aligned component should come left side of the page and right aligned component should come right side…
Suresh Basina
  • 185
  • 1
  • 6
  • 14
6
votes
3 answers

In WPF, is there a way to make a StackPanel with aligned columns like a Grid?

For example I could do something like this:
Matt
  • 21,026
  • 18
  • 63
  • 115
5
votes
2 answers

Using StackPanel as ContentControl (WPF)

So I have a StackPanel that I am using as a ContentControl. I have a place where I want buttons to be generated based on data that I am binding to, and that is all working good, but I want the buttons to be laid out horizontally, not vertically as…
James McConnell
  • 2,180
  • 3
  • 19
  • 29