stackpanel

wpf layout question

<Window ... > <StackPanel> <Button>b1</Button> <Button>b2</Button> </StackPanel> </Window> how to make this look like this: <Window ...> <Grid> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Butto...

Padding on StackPanel?

Hello folks! I am trying to set padding of a StackPanel but there ain't such property. I tried StackPanel.Border, but there is no such property either. Any ideas? ...

WPF VirtualizingStackPanel for increased performance

I would like a simple description of how to implement a virtualizingstackpanel for an ItemsControl that is databound to an observable collection in my MVVM. I have an ItemsControl instance for each tab in a tab control, and switching tabs becomes VERY slow when the ItemsControl grows larger. What can I do to speed up the app? I open...

WPF StackPanel controls order

Hello, Is there a way to change the order of the controls inside a StackPanel at runtime? Many thanks, Paulo ...

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 appreciated! ...

How can I set the MinHeight of a StackPanel to be the combined height of its contents?

I have a StackPanel with several CheckBox controls inside it. How do I prevent the StackPanel from shrinking and obscuring the CheckBox controls when the window is resized? <StackPanel Margin="12,89,12,62" Name="stackPanel1"> <CheckBox Name="chkOption1" Width="157" IsChecked="True" Margin="6">Do this thing</CheckBox> ...

How to make a StackPanel Width that of another StackPanel?

I have two dockpanels which each have a left StackPanel. The width of the bottom StackPanel is determined by the width of the text is in it. The width of the top StackPanel should be the same as the width of the bottom StackPanel. I've tried to bind the Width of the top StackPanel to the Width of the bottom StackPanel via ElementName ...

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 StackPanel is done repositioning all of it's children. StackPanel sp = new StackPanel();...

[WPF]Databinding stackpanel

Hi Im a beginner in WPF programming, coming from .NET 2.0 C#. Im trying to make a horisontal 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 and then stack those two items horisontally. Here's some pseudo-code to display what ...

Stack Overflow After 15 Recursions with Javascript Class Function

I have the following code sample to illustrate my point. When I load this in IE8 on Vista I get the error "Stack Overfow at line:16" If I recurse using a top level function (outside of the testClass object) I can recurse millions of times without a stack overflow. Why is this happening? Ultimately I just implemented a Function Que ins...

StackPanel draws artifacts between each child control

hi, i'm trying to draw a rectangle with semi-circles at either end. i'm also trying to split the rectangle where the left half is a different colour to that of the right half. i've managed to do this using a stack panel and CombinedGeometry, as in the example below. however, the code below draws a line inbetween each control within the s...

WPF Remove Margin Animation Programmatically

How do I remove the margins of two sides of a stackpanel in an animation storyboard so it looks like the stackpanel has moved from the code behind? I need to do it in the code-behind because the number of stackpanels i use this animation on differs at runtime. Thanks :o) ...

Which has better rendering performance, Stackpanel or Canvas+TranslateTransform? WPF/Silverlight

I always use a Canvas when I'm laying out my visuals usually because I will need adjust the RenderTransform.TranslateTransform to animate in some way. A colleague recently told me that unless I explicitly need to animate I should always use the A Stackpanel because it is faster than a RenderTransform.TranslateTransform when laying out ob...

WPF: filling the "gap" in a StackPanel of buttons when removing one of the buttons

I am defining a StackPanel containing multiple Buttons in my xaml file. I'd like to be able to remove buttons based on some events, and have the "gap" where that button was be filled by having the following Buttons move up on the screen. I used: buttonName.Visibility = System.Windows.Visibility.Hidden; but that just hides the button an...

how can we change zindex of a silverlight control programmatically?

Hello I have some controls added in a stackpanel programmatically. What i want to do is that i want one of the controls in this stackpanel to be placed over another control. Specifically, I want to place button over an image in this stack panel. I couldn't find zindex property in c# codebehind. Although it seems very simple problem but i...

WPF StackPanel with Click AND DoubleClick

Hi! 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 you ...

ScaleTransform applied to elements in stackpanel causes "white" space

When I add UserControls that have a ScaleTransform applied to them to a StackPanel, I see that there is extra space in between the controls as though the transform was not applied. From what I understand, a transform doesn't actual change the width/height of a control, but rather changes the render width/height. If this is the case, ho...

wpf textblock autosize/layout in stackpanel

I have the following stack panel <StackPanel> <TextBlock Text="{Binding AddressLine1}" /> <TextBlock Text="{Binding AddressLine2}" /> <TextBlock Text="{Binding AddressLine3}" /> <TextBlock Text="{Binding AddressLine4}" /> </StackPanel> and my AddressLine2 string is null on the bound object. My stack pane...

Binding Data to a TextBlock using Domain Data Source

I have a map with hotspots for each state (done in Expression Blend). I capture each MouseEnter of the state (1 thru 50). I pass that into my Domain Data Source: Dim activebox As Path = TryCast(sender, Path) activebox.Fill = mouseOverColor Dim StateID As Integer = CInt(Right(activebox.Name, 2)) Dim _StateContext As N...

Spacing buttons equally across a window in WPF

What's the best control to arrange buttons horizontally across a window in WPF? I am having trouble arranging the buttons evenly while resizing the window. I tried to use the stack panel but the buttons just stay at their position and do not space out to fill up the window space. Tried to use the dock panel as well but no luck yet. Can ...