WPF looking for way to create border with text labeling the frame

c#, forms, wpf, xaml

Solution

Sounds like you need a GroupBox. I wrote an article about these but I won't post a link, as I don't like using StackOverflow for promoting web sites. I will post the opening example XAML though so you can see the effect and check if it's what you want.

<Window x:Class="GroupBoxDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="GroupBox Demo"
        Width="250"
        Height="180">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <GroupBox Header="Mouse Handedness">
            <StackPanel>
                <RadioButton Content="Left-Handed" Margin="5"/>
                <RadioButton Content="Right-Handed" Margin="5" IsChecked="True"/>
            </StackPanel>
        </GroupBox>

        <GroupBox Grid.Row="1" Header="Double Click Speed">
            <Slider Margin="5" />
        </GroupBox>
    </Grid>
</Window>

It looks like:

Problem

Something like this was available in windows forms, but i forget what it was called. But I'm just looking for some good borders to outline regions that allows me to name the region.

Original source