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请重新阅读我的帖子。该代码段位于您无权访问的类中。