I know I have several options to use when it comes to dividing up my window into separate sections (e.g., DockPanel, StackPanel, etc). My Windows application requires that the user be able to adjust the size of different sections at runtime, similar to how a user can adjust FRAME widths in HTML. Does anyone have suggestions for what type/types of controls to use to accomplish this in C# WPF? If you have any code that would illustrate how a user can mouse-over a section boundary and click-hold to adjust the size, that would be ideal.
System.Windows.Controls.GridSplitter
http://msdn.microsoft.com/en-us/library/system.windows.controls.gridsplitter.aspx
Example:
<Grid VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="5" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ListBox Grid.Row="0" >
<TextBlock>Hello</TextBlock>
</ListBox>
<GridSplitter Grid.Row="1"
Height="5" Background="Gray"
VerticalAlignment="Top"
HorizontalAlignment="Stretch" />
<ListBox Grid.Row="2" >
<TextBlock>World</TextBlock>
</ListBox>
</Grid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With