Click here to Skip to main content
15,881,881 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to add TITLE1234 on center of the window.
HTML
<window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xml:lang="en-US&"
    xmlns:abc="clr-namespace:abc"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:abc"    
    x:Class="abc.Window1"
    x:Name="Window"
    Title="TITLE1234"
    MinHeight="100"
    MinWidth="200"
 AllowsTransparency="False"
 removed="Transparent"
    Height="600" 
Width="900"
 WindowStyle="SingleBorderWindow"
 Loaded="Window_Loaded"

    ResizeMode="CanResize"
 WindowStartupLocation="CenterScreen" 
Icon="/abc;component/HIDexe.ico" PreviewKeyDown="Window_PreviewKeyDown" 
MouseLeftButtonDown="Window_MouseDown"
     >
</window>
Posted
Updated 20-Oct-11 1:00am
v2

1 solution

Add TextBlock.TextAlignment="Center" to your window element
 
Share this answer
 
Comments
Simon Bang Terkildsen 20-Oct-11 10:37am    
I'm sorry but that won't work, the only way is to create a style for the window.
Reiss 21-Oct-11 3:26am    
I was certain I had done it like that in the past - must be going mad
Tarun.K.S 22-Oct-11 8:46am    
It worked for me. It will display the Title at the center of Window's "Title bar", but definitely not at the center of Window itself. It's quite unclear what the OP wants, my 5 anyway.
Member 7909353 25-Oct-11 1:55am    
It is not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900