CommandBar does not show label fully

Hong 1,436 Reputation points
2023-10-23T23:39:11.9733333+00:00
  <Grid 
      x:Name="gridRoot" 
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
      PointerEntered="Grid_PointerEntered" 
      PointerExited="Grid_PointerExited" PointerMoved="Grid_PointerMoved"
      SizeChanged="gridRoot_SizeChanged"
      VerticalAlignment="Stretch"
      HorizontalAlignment="Stretch"
      toolkit:VisibleBoundsPadding.PaddingMask="All"
        >
      
      <CommandBar
          x:Name="foo"
          VerticalAlignment="Bottom"
          Margin="0" 
          IsOpen="True"
          ClosedDisplayMode="Compact"
          >
          <AppBarButton 
              x:Name="abEmail" 
              Label="Test Email Button" 
              ToolTipService.ToolTip="For debugging" 
              Icon="Mail" 
              Click="abbEmailLog_Click"/>
      </CommandBar>
<grid>


When the CommandBar is open, it looks like the following:

User's image

When it is closed, it looks like the following:

enter image description here

How can I make the CommandBar display the label fully?

Developer technologies | Universal Windows Platform (UWP)
{count} votes

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 21,731 Reputation points
    2023-10-24T02:16:57.24+00:00

    Hello @Hong ,

    Welcome to Microsoft Q&A!

    If you want to use AppBarButton in the bottom of the page, it is recommended to use Page.BottomAppBar.

     <Page.BottomAppBar>
            <CommandBar
              x:Name="foo"
              IsOpen="True"
              ClosedDisplayMode="Compact">
                <AppBarButton 
                  x:Name="abEmail" 
                  Label="Test Email Button" 
                  ToolTipService.ToolTip="For debugging" 
                  Icon="Mail"/>
            </CommandBar>
    </Page.BottomAppBar>
    
    

    User's image

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.