Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF Application UI
Hi All,
Im building a WPF Windows Application. This is running with a Ribbon Toolbar - so its affectively a Ribbon Window
 
I have the Window configured with a title of "Test Window" at present
 
The title is left aligned in the Window Bar
 
Does anyone know of a way I can center the window title text? Like Office 2010 for example...
 
I guess there is probably a nasty way of programatically inserting spaces into the Title value before the actual text - which is nasty if the User resizes the window
 
Anyone know of ideas ?
 
Greatly appreciate your help,
 
Cheers,
Dan
Posted 29-Jan-11 9:05am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I haven't looked all the way through this[^] but it has stuff similar to what you want to do.
 
Have a play. Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You should remember, a Window in WPF control is composed of GDI portion (which includes the Title bar, outer boundary etc) and the WPF portion in the middle.
 
If you are dealing with Ribbon control, generally you need to disable the Title bar and recreate the title of your own.
 
something like this :
http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!345.entry[^]
 
To know about Ribbon you can go through :
http://www.abhisheksur.com/2010/08/introducing-ribbon-ui-control-for-wpf.html[^]
Rose | [Rose]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 Andreas Gieriet 90
4 Jochen Arndt 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 29 Jan 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100