Пример #1
0
        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"
     });
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 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"
     });
 }
Пример #5
0
        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"
             * });
             */
        }
Пример #6
0
        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"
            });
        }
Пример #7
0
        /// <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");
            }
        }
Пример #8
0
        /// <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);
        }
Пример #9
0
        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);
 }
Пример #11
0
 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);
 }