Why is my RibbonWindow not themed correctly?
Asked Answered
M

2

9

Working with the ribboncontrolslibrary, when I run my application the title bar looks like W98 application,. How can I make it look pretty?

Edit: It seems that has something to do with the theme used on windows.

any help would be appreciated.

alt text http://img718.imageshack.us/img718/8188/321321.jpg

<r:RibbonWindow x:Class="Produccion_Dampers.main"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
 Title="Window1"
 Height="600"
 Width="800">
    <DockPanel>
        <r:Ribbon DockPanel.Dock="Top" Title="my App looks like s***t">
        </r:Ribbon>
    </DockPanel>
</r:RibbonWindow>
Muhammadan answered 28/1, 2010 at 18:5 Comment(1)
+1 for "My app looks like shit".Colonial
I
2

(from my previous comment)

You can draw a custom window frame as described in this MSDN article: http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx, which includes information about drawing the window caption with the system theme's font (which might provide clues about accessing other theme information).

Indubitability answered 29/1, 2010 at 19:6 Comment(0)
I
2

If you are running a custom theme on your machine, WPF windows default to the "Classic" theme.

As I understand, your options are then limited because the title bar is non-client to your application -- it is rendered by the OS (why then it can't adopt the custom theme, I don't know).

(If the last one works, it means my understanding about rendering the title bar is incorrect.)

Indubitability answered 28/1, 2010 at 21:27 Comment(5)
...oh, you could also put all of your WPF stuff inside a WinForms window.Indubitability
I could but then the ribbon wouldn't "fuse" with the titlebarMuhammadan
do you have an example of the p/invoke solution?Muhammadan
Well, I found this MSDN page about drawing a custom frame, and it includes information about drawing the caption in the system theme font, but not specifically re-drawing the frame with a particular theme. msdn.microsoft.com/en-us/library/bb688195(VS.85).aspxIndubitability
thanks, this looks very promising, I might be writing my own ribbon now, post as an answer to accept it as an alternative!!!Muhammadan
I
2

(from my previous comment)

You can draw a custom window frame as described in this MSDN article: http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx, which includes information about drawing the window caption with the system theme's font (which might provide clues about accessing other theme information).

Indubitability answered 29/1, 2010 at 19:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.