为什么我的 RibbonWindow 主题不正确?
使用功能区控件库,当我运行应用程序时,标题栏看起来像 W98 应用程序。怎样才能让它看起来漂亮呢?
编辑:这似乎与Windows上使用的主题有关。
任何帮助将不胜感激。
替代文本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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(来自我之前的评论)
您可以按照此 MSDN 文章中的描述绘制自定义窗口框架:http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx,其中包含有关绘制窗口的信息带有系统主题字体的标题(这可能提供有关访问其他主题信息的线索)。
(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).
如果您在计算机上运行自定义主题,WPF 窗口默认为“经典”主题。
据我了解,您的选择受到限制,因为标题栏对于您的应用程序来说不是客户端——它是由操作系统呈现的(为什么它不能采用自定义主题,我不知道)。
(如果最后一个有效,则意味着我对渲染的理解标题栏不正确。)
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.)