gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 07:11:03 26 4
gpt4 key购买 nike

我正在显示我的应用程序中的 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>

Sample Image

最佳答案

I am showing WorkflowElementDialog from my application, this dialog box having a question mark beside close button. is there a way to remove it?


恐怕没有内置方法可以从标题区域中删除问号;这实际上称为上下文帮助按钮。当您调用 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 例程;但这需要一些工作和一些源代码浏览。

引用资料:

WorkflowElementDialog Source

关于c# - 如何从工作流对话框中删除标题中的问号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60931208/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com