Varga Varga - 2 months ago 17
C# Question

How to I create a square in WPF where there is room for text in between the top line .NET C#

So I've seen alot of applications that has this type of design to it and I'm really curious on how it is done. Makes it look a bit more "Professional"
What it is is a box like so

I dont have an application with code at the moment but I would create one with this feature if I knew how it was done and what its called.
I tried googleing stuff like "How to draw a rectangle in wpf" and similar things but the things that popped up we're not what I was looking for.

Here is a picture showing you a example
enter image description here

Answer

Try this

<GroupBox>
    <GroupBox.Header>
      <Label>Hello</Label>
    </GroupBox.Header>
    <TextBlock Text="World!" />
</GroupBox>