Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set textwrapping in Button

Tags:

winrt-xaml

did a search on internet, could not find the solution. I think I missed something for below code to make the text wrap:

<Button x:Name="btnCustomerAging" Background="Green" BorderBrush="Green" Foreground="White" FontSize="33" HorizontalAlignment="Left" Margin="662,106,0,0" Grid.Row="1" VerticalAlignment="Top" Height="213" Width="238">

            <TextWrapping>  

              Customer Locations

            </TextWrapping>


</Button>
like image 882
MilkBottle Avatar asked Sep 04 '13 02:09

MilkBottle


People also ask

How do I break a word in a button?

Another way of adding a line break is using the CSS word-break property, which specifies how words should break when reaching the end of a line. Put your button text in a <span> element and give styling to it. Use the "keep-all" value of the word-break property and set the width.

Where is the Wrap text button?

On the Home tab, in the Alignment group, click Wrap Text.

How do I turn on text wrapping in Word?

Select Format and then under Arrange, select Wrap Text. Choose the wrapping option that you want to apply.

Can you wrap text in a text box?

Enable or disable text wrapping for a text box, rich text box, or expression box. Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click the Display tab. Select or clear the Wrap text check box.


1 Answers

This will work.

<Button x:Name="btnCustomerAging" Background="Green" BorderBrush="Green" Foreground="White" FontSize="33" 
        HorizontalAlignment="Left" Margin="662,106,0,0" Grid.Row="1" VerticalAlignment="Top" Height="213" Width="238">
    <TextBlock Text="Customer Locations" TextWrapping="Wrap" />
</Button>
like image 162
Farhan Ghumra Avatar answered Sep 22 '22 02:09

Farhan Ghumra