Quantcast
Channel: Aligning controls on both left and right side in a stack panel in WPF - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by newfurniturey for Aligning controls on both left and right side in a stack panel in WPF

$
0
0

As you have set the StackPanel's orientation to Horizontal, the HorizontalAlignment property won't work on child-elements. You can keep the StackPanel if you need additional controls, though I would recommend switching to a Grid (among other things) to build the layout you want.

Also, the Grid will allow you to control the actual width of each column:

<Grid><Grid.ColumnDefinitions><ColumnDefinition Width="50" /><ColumnDefinition Width="150" /></Grid.ColumnDefinitions><RadioButton        Grid.Column="0"        ...    /><Label        Grid.Column="1"        ...    /></Grid>


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>