Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从工作流对话框的标题中删除问号?_C#_Wpf_Workflow - Fatal编程技术网

C# 如何从工作流对话框的标题中删除问号?

C# 如何从工作流对话框的标题中删除问号?,c#,wpf,workflow,C#,Wpf,Workflow,我正在从我的应用程序中显示WorkflowElementDialog,该对话框在关闭按钮旁边有一个问号。有没有办法把它去掉 Xaml代码 <sap:WorkflowElementDialog x:Class="SqlEditorDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200

我正在从我的应用程序中显示
WorkflowElementDialog
,该对话框在关闭按钮旁边有一个问号。有没有办法把它去掉

Xaml代码

<sap:WorkflowElementDialog x:Class="SqlEditorDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib"
        xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
        xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
        xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
        Title="{x:Static p:Resources.EditSql}">

</sap:WorkflowElementDialog>

我正在从我的应用程序中显示WorkflowElementDialog,这个对话框在关闭按钮旁边有一个问号。有没有办法把它去掉


恐怕没有内置的方法可以从标题区域中删除问号;这实际上被称为上下文帮助按钮。当您调用
Show
或创建实例时,它将创建一个
WorkflowElementDialogWindow
的新实例。该类有一个名为
OnInitialized
的例程,该例程设置了一些属性,并调用它从中派生的基类,称为
DialogWindow
,然后调用
OnSourceInitialized()
。在这个例程中,实际的上下文按钮是在这里创建的,下面是它的外观

 protected override void OnSourceInitialized(EventArgs e)
 {
      base.OnSourceInitialized(e);
      this.HideMinMaxButton();
      this.ShowContextHelpButton(); // Here's the culprit.
      this.HideIcon();
      this.AddWindowsHook(new HwndSourceHook(DialogWindow.OnHookedWindowMessage));
      base.get_CommandBindings().Add(new CommandBinding(ApplicationCommands.get_Help(), new ExecutedRoutedEventHandler(this.OnHelpExecuted)));
      base.Closing += new CancelEventHandler(this.OnWindowClosing);
 }
一个选项是重新创建类,然后您可以省去
ShowContextHelpButton
例程;但这需要一些工作和一些源代码浏览来完成

参考资料:


OnSourceInitialized(eventargs):在添加code@madan请重新阅读我的帖子。该代码段位于您无权访问的类中。