Home > Software engineering >  WinUI 3 - How can I add text on grid border?
WinUI 3 - How can I add text on grid border?

Time:12-21

I want to "name" some grids in my program like this, so it is easier to navigate through it: [So I want to sign all grids on their Border] (https://i.stack.imgur.com/nGr8o.jpg)

I was onle able to achieve this: What I got

I did it by putting both Grid and TextBlock in the same position in another, bigger Grid

 <TextBlock
            Grid.Row="1"
            Grid.Column="0"
            Text="Test"
            Margin="5, 0, 0, 0"/>
 <Grid
            Name="eingabeAndTabs"
            Grid.Row="1"
            Grid.Column="0"
            Padding="5"
            Margin="0,10,0,0"
            BorderBrush="Gray"
            BorderThickness="2">

Is there any way to make it look better?

CodePudding user response:

Have you tried to surround your Grid by a GroupBox?

<GroupBox Name="Test">
      
    <Grid Name="eingabeAndTabs" ... />
        
</GroupBox>
  • Related