How to remove Question mark from Title from Workflow Dialog?

Viewed 211

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

Xaml Code

<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

1 Answers

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


I am afraid there's no built in way to remove the question mark from the title area; this actually is called a context help button. When you call Show or an instance is created, it will create a new instance of a WorkflowElementDialogWindow This class has a routine called OnInitialized which set's some properties as well as call the base class it derives from called DialogWindow and then calls OnSourceInitialized(). In this routine is where the actual context button is created, here's what it looks like.

 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);
 }

One option is to re-create the classes, then you can leave out the ShowContextHelpButton routine; but this would require a little work and some source browsing to do.

References:

WorkflowElementDialog Source

Related