Customize the action when the X button of the dialog box in the msi is clicked #1738
Unanswered
kokleong-idea
asked this question in
Q&A
Replies: 1 comment
-
Since you are using custom UI have access to the parent form hosting the dialogs. For WPF UI dialogs the solution would be: public partial class WelcomeDialog : WpfDialog, IWpfDialog
{
public WelcomeDialog()
{
InitializeComponent();
}
public void Init()
{
this.DataContext = model = new WelcomeDialogModel { Host = ManagedFormHost };
ManagedFormHost.ParentForm.FormClosing += (s, e) =>
{
if (MessageBoxResult.Yes != MessageBox.Show("Do you want to close?", "FormClosing", System.Windows.MessageBoxButton.YesNo))
e.Cancel = true;
};
} If you want to remove the borders you can do it programmatically by changing the top level hosting form bodred style. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using WixSharp Managed Setup - Custom WPF UI (WiX4) project template to build msi. I found that when I click on the X button on the top right hand corner, the msi dialog is immediately closed without prompting for confirmation. May I know how can I customize the response when the X button is clicked by the users?
In addition, I would also like to find out whether there is a way to hide the top bar of the msi dialog box so that the minimize and X buttons are not visible so that I can add my customized X button.
I am looking forward to your prompt advice. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions