Click here to Skip to main content
13,096,157 members (52,657 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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,

Posted 29-Jan-11 8:05am
Rate this: bad
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. :)
Rate this: bad
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 :!9C9E888164859398!345.entry[^]

To know about Ribbon you can go through :[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 29 Jan 2011
Copyright © CodeProject, 1999-2017
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