本文介绍了(错误)以系统托盘中的简单格式代码显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我将一个notifyicon从工具箱拖动到窗体中,然后在属性中设置图标.然后,将您的代码粘贴到以下表单中:

First I drag a notifyicon from toolbox to form, and set the icon in property. Then I paste your code to the form as below:

private void TrayMinimizerForm_Resize(object sender, EventArgs e)
{
   notifyIcon1.BalloonTipTitle = "Minimize to Tray App";
   notifyIcon1.BalloonTipText = "You have successfully minimized your form.";
 
   if (FormWindowState.Minimized == this.WindowState)
   {
      notifyIcon1.Visible = true; 
      notifyIcon1.ShowBalloonTip(500);
      this.Hide();
   }
   else if (FormWindowState.Normal == this.WindowState)
   {
      notifyIcon1.Visible = false;
   }
}
 
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
   this.Show();
   this.WindowState = FormWindowState.Normal;
}

有什么问题吗?它进入系统托盘,但没有气泡显示.因此,单击缩小"后,我无法在系统托盘中找到任何表格.

Is there any problem? It goes in system tray but no bubble form is show. So after clicking in minize i cant find any form in system tray.

推荐答案


这篇关于(错误)以系统托盘中的简单格式代码显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 09:13