예제 #1
0
 public static DialogResult ShowSelectConfigFileBox(Form Parent)
 {
     if (WinVer.IsVistaOrGreater())
     {
         TaskDialog dlg = new TaskDialog();
         dlg.SetIcon(TASKDIALOG_ICON.TD_INFORMATION_ICON);
         dlg.WindowTitle     = "Open configuration file";
         dlg.MainInstruction = "You will see this dialog if the configuration file (menu.xml) is missing from your system";
         dlg.AddButton((int)DialogResult.Yes, "Create a config file").ShowShield = true;
         dlg.AddButton((int)DialogResult.No, "Open an existing config file");
         dlg.CommonButtons   = TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_CANCEL_BUTTON;
         dlg.UseCommandLinks = true;
         return((DialogResult)dlg.ShowDialog(Parent.Handle));
     }
     else
     {
         return(MessageBox.Show(Parent, "You will see this dialog if the configuration file (menu.xml) is missing from your system\n\nYes - Create a config file\nNo - Open an existing config file\nCancel - Quit", "Open configuration file", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information));
     }
 }