Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF panel header title

Tags:

c#

wpf

I am not sure they correct terminology for a header/title bar of a component in WPF. What I need is a panel/non-floating window, in which I can set the title? I want a few components in a panel that needs a title like Properties and Toolbox in Visual Studio.

As mentioned earlier, this doesn't need to be a floating/docking panel. I don't want GroupBox. I will be adding close button later just to hide the component from the user.

like image 710
huber.duber Avatar asked Feb 10 '23 13:02

huber.duber


1 Answers

I think, that in WPF visual solutions are limited only by our imagination. If there isn't the control you want - you can build it.

My simple solution is here:

<Border Visibility="Visible" BorderThickness="2" BorderBrush="Blue" CornerRadius="8" Margin="30,30,30,30">
    <StackPanel Margin="3">
        <Label  Height="25" Content="H e a d e r" Background="LightSkyBlue" />
            <Separator Height="5"/>
            <Grid>
                <!-- content -->
            </Grid>
        </StackPanel>
    </Border>

Changing Visibility="Collapsed" you can hide this "panel".

like image 83
cypizek Avatar answered Feb 13 '23 04:02

cypizek