在右上角的关闭按钮旁边创建一个带问号的WPF窗口,可能吗? [英] creat a WPF window with question mark next to close button on the upper right corner, possible?

查看:153
本文介绍了在右上角的关闭按钮旁边创建一个带问号的WPF窗口,可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

共享Excel AddIn,VS 2008,C#,WPF

Shared Excel AddIn, VS 2008, C#, WPF

Excel 2007主窗口的右上角有4个小图标。

There are 4 tiny icons in the uppper right corner of Excel 2007 Main Window.

他们是 蓝色问号(Microsofte Office Excel帮助(F1)),最小化窗口的图标,恢复窗口的图标,关闭窗口的图标。

and they are  a blue question mark(Microsofte Office Excel Help(F1)), an icon to minimize window, an icon to restore window, an icon to close window.

我想添加问号在我的WPF窗口上,所以当用户点击问号时,我的帮助文件显示

I want to add a question mark on my WPF window so when users click the question mark, my help file shows up

但不知道该怎么办?谢谢

But do not know how to do? thanks

 

推荐答案

Hi Yinruhou,

Hi Yinruhou,

我认为有可能实现这样的目标。您可以自定义WPF窗口,然后将其加载到Shared AddIn。要使用问号自定义wpf窗口,下面是您要引用的XAML代码:

I think it possible to achieve such goal. You can custom the WPF window and then load it your Shared AddIn. For customizing the wpf window with question mark, below is the XAML code for you to reference:


<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
  <Window.CommandBindings>
    <CommandBinding Command="Help" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed"/>
  </Window.CommandBindings>
  <Grid>
    <Button Command="Help" Width="24" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
      <Image Source="C:\Users\bruce\Desktop\help.png"/>
    </Button>
  </Grid>
</Window>


这篇关于在右上角的关闭按钮旁边创建一个带问号的WPF窗口,可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆