Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to add title(ToolBar Full Width Sample) in the middle of window.
Please hellp me!
XML
<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="Window1"
  Title="ToolBar Full Width Sample" Height="300" Width="300"
  Background="#FFFFFFFF">

  <Grid>


      </Grid>
</Window>
Posted

1 solution

You need to add
C#
TextBlock.TextAlignment="Center"
to get

XML
<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="Window1"
  Title="ToolBar Full Width Sample" Height="300" Width="300"
  Background="#FFFFFFFF" TextBlock.TextAlignment="Center">
  <Grid>
  </Grid>
</Window>
 
Share this answer
 
Comments
RaviRanjanKr 17-Oct-11 10:17am    
Right, My 5+
Sergey Alexandrovich Kryukov 24-Oct-11 19:21pm    
I tried, it does work in Designer but not during runtime. How? This is a feature of Windows OS, there is no such feature unless you re-write non-client area using raw Windows API.
I suggested another alternative, I think more reasonable one, please see http://www.codeproject.com/Answers/271704/location-of-title-in-title-bar-in-microsoft-window#answer3.

Please note that OP spams CodeProject with the same question; should not be encouraged. :-)
--SA

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