public void ApplyIcons() { if (_inheritAppIcon) { _icon = ImageProvider.GetAppIcon(true); } base.ShowIcon = true; base.Icon = _icon; }
private void UpdateIcon() { if (_isAboutBox) { pbImage.Image = ImageProvider.GetAppIcon(true).ToBitmap(); pbImage.Size = pbImage.Image.Size; pbImage.Visible = true; SystemSounds.Asterisk.Play(); } else { switch (icon) { case MessageBoxIcon.Warning: pbImage.Image = ImageProvider.GetUser32Icon(User32Icon.Warning, true); pbImage.Size = pbImage.Image.Size; pbImage.Visible = true; SystemSounds.Exclamation.Play(); break; case MessageBoxIcon.Error: pbImage.Image = ImageProvider.GetUser32Icon(User32Icon.Error, true); pbImage.Size = pbImage.Image.Size; pbImage.Visible = true; SystemSounds.Hand.Play(); break; case MessageBoxIcon.Question: pbImage.Image = ImageProvider.GetUser32Icon(User32Icon.Question, true); pbImage.Size = pbImage.Image.Size; pbImage.Visible = true; SystemSounds.Question.Play(); break; case MessageBoxIcon.Information: pbImage.Image = ImageProvider.GetUser32Icon(User32Icon.Information, true); pbImage.Size = pbImage.Image.Size; pbImage.Visible = true; SystemSounds.Asterisk.Play(); break; default: pbImage.Image = null; pbImage.Size = new Size(1, 1); pbImage.Image = null; pbImage.Visible = false; SystemSounds.Beep.Play(); break; } } }
public MainForm() : base("TXT_APP_NAME") { AppConfig.CanSendToTray = true; InitializeComponent(); mnuMediaState.ForeColor = ThemeManager.MenuTextColor; this.OverrideBackColor = ThemeManager.GradientNormalColor2; mediaPlayer.MinimumSize = new Size(0, 0); if (!this.DesignMode) { commandQueue = new Queue <BasicCommand>(); commandExecTimer = new Timer(); commandExecTimer.Enabled = true; commandExecTimer.Tick += new EventHandler(OnCommandExecTimerTick); commandExecTimer.Interval = 500; commandExecTimer.Start(); cmsMain.Font = ThemeManager.NormalFont; notifyIcon.Icon = ImageProvider.GetAppIcon(false); _msgTarget = new TrayNotificationTarget(notifyIcon, this); this.Resize += new EventHandler(MainForm_Resize); this.Shown += new EventHandler(MainForm_Shown); this.HandleDestroyed += new EventHandler(MainForm_HandleDestroyed); this.mnuTools.Image = OPMedia.UI.Properties.Resources.Settings16; this.notifyIcon.ContextMenuStrip = this.cmsMain; mediaPlayer.SetRenderingMenu(cmsMain); OnPerformTranslation(); MediaRenderer.DefaultInstance.FilterStateChanged += new FilterStateChangedHandler(OnMediaStateChanged); MediaRenderer.DefaultInstance.RenderedStreamPropertyChanged += new RenderedStreamPropertyChangedHandler(OnStreamTitleChanged); } }