Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

XAML: Text break in the button

 

WPF, UWP, XAML, TextWrap, Wrap, LineBreak

 

The UIElement, Framework ElementButton has no direct option for the text break.

If you want a text break in a button, you have to either set a sub-element TextBlock inside the button and in this the automatic break with TextWrapping = "WrapWithOverflow"

Or you write the break to the Content property

 

<Button x:Name="btnApp_ScreenShot_as_File" VerticalAlignment="Top" HorizontalAlignment="Left" Height="100" Width="100" >

    <TextBlock TextWrapping="WrapWithOverflow" >App Screenshot as File</TextBlock>

</Button>

 

 

 

Alternatively, you can set a character directly in the content

<Button x:Name="btnApp_ScreenShot_as_File" VerticalAlignment="Top" HorizontalAlignment="Left" Height="100" Width="100"

            Content="App Screenshot &#xa; as File">

</Button>

Mobile
»
XAML: Text break in the button
»
WPF Windows Font icons with Segoe MDL2 Asset
»
WPF: Order files
»
WPF: Open Windows File Explorer
»
WPF: how do I find the MainWindow
»
WPF: Application Link, Shortcut erstellen und in Startup Folder legen
»
WPF: Settings speichern zum Programm, Anwendung
»
WPF: Zeilenumbruch in einer Messagebox
»
WPF: Minimize to Tray
»
WPF: Zeilenumbruch in WPF Button

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de