void msg() { MessageBoxResult result = MessageBox.Show("Đăng ký thành công.\nQuay lại đăng nhập?", "", MessageBoxButton.YesNo, MessageBoxImage.Information); if (result == MessageBoxResult.Yes) { ButtonClose.Command.Execute(null); } }
private void ButtonCustomMessage_OnClick(object sender, RoutedEventArgs e) { MessageBox.Show(new MessageBoxInfo { Message = Properties.Langs.Lang.GrowlAsk, Caption = Properties.Langs.Lang.Title, Button = MessageBoxButton.YesNo, IconBrushKey = ResourceToken.AccentBrush, IconKey = ResourceToken.AskGeometry, StyleKey = "MessageBoxCustom" }); }
public void Divide(double left, double right) { Thread.Sleep(600); if (CanDivide(left, right) == true) { Result = left / right; } else { MessageBox.Show("Divider cannot be zero.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void ButtonCustomMessage_OnClick(object sender, System.Windows.RoutedEventArgs e) { MessageBox.Show(new MessageBoxInfo { Message = "A new version has been detected! Do you want to updata?", Caption = "Title", Button = MessageBoxButton.YesNo, IconBrushKey = ResourceToken.AccentBrush, IconKey = ResourceToken.AskGeometry, StyleKey = "MessageBoxCustom" }); }
private void But_Close_Click(object sender, System.Windows.RoutedEventArgs e) { MessageBox.Ask("This came here"); /* * Growl.Info(new GrowlInfo * { * Message = "we found new version", * CancelStr = "later", * ConfirmStr = "lets do this" * }); */ }
private void Test_Click(object sender, System.Windows.RoutedEventArgs e) { // Message = "Test", Caption = "Url", Button = MessageBoxButton.YesNo, IconBrushKey = ResourceToken.AccentBrush, IconKey = ResourceToken.InfoGeometry, StyleKey = "MessageBoxCustom" MessageBox.Show(new MessageBoxInfo { Message = "show this", Caption = "Title", Button = MessageBoxButton.YesNo, IconBrushKey = ResourceToken.AccentBrush, IconKey = ResourceToken.AskGeometry, StyleKey = "MessageBoxCustom" }); }
/// <summary> /// Pass Url to Internet Download Manager /// </summary> /// <param name="link"></param> public static void DownloadWithIDM(string link) { var command = $"/C /d \"{link}\""; if (File.Exists(Consts.IDManX64Location)) { Process.Start(Consts.IDManX64Location, command); } else if (File.Exists(Consts.IDManX86Location)) { Process.Start(Consts.IDManX86Location, command); } else { MessageBox.Error("Internet Download Manager (IDM) is not installed on your system, please download and install it first", "Not Found"); } }
/// <summary> /// Set folder icon for a given folder. /// </summary> /// <param name="icoFile"> path to the icon file [MUST BE .Ico]</param> /// <param name="folderPath">path to the folder</param> public static void SetFolderIcon(string icoFile, string folderPath) { try { var folderSettings = new SHFOLDERCUSTOMSETTINGS { dwMask = FOLDERCUSTOMSETTINGSMASK.FCSM_ICONFILE, pszIconFile = icoFile, dwSize = (uint)Marshal.SizeOf(typeof(SHFOLDERCUSTOMSETTINGS)), cchIconFile = 0 }; //FolderSettings.iIconIndex = 0; var pszPath = folderPath; var unused = SHGetSetFolderCustomSettings(ref folderSettings, pszPath, FCS.FCS_FORCEWRITE); } catch (Exception e) { MessageBox.Error(e.Message); } ApplyChanges(folderPath); }
public void SetDesktopWallpaper(string file_name, bool update_registry) { try { // If we should update the registry, // set the appropriate flags. uint flags = 0; if (update_registry) { flags = SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE; } // Set the desktop background to this file. if (!SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, file_name, flags)) { MessageBox.Show("SystemParametersInfo failed.", "Error"); } } catch (Exception) { MessageBox.Show("Error displaying picture ", "Error"); } }
private void ButtonMessage_OnClick(object sender, RoutedEventArgs e) { MessageBox.Show(Properties.Langs.Lang.GrowlAsk, Properties.Langs.Lang.Title, MessageBoxButton.YesNo, MessageBoxImage.Question); }
private void ButtonMessage_OnClick(object sender, System.Windows.RoutedEventArgs e) { MessageBox.Show("A new version has been detected! Do you want to updata?", "Title", MessageBoxButton.YesNo, MessageBoxImage.Question); }