• winform如何最小化成托盘图标


        public partial class MainForm : Form
        {
            FormWindowState fws 
    = FormWindowState.Normal;

            
    public MainForm()
            {
                InitializeComponent();
                
    this.SizeChanged += new EventHandler(MainForm_SizeChanged);
                
    this.notifyIcon1.DoubleClick += new EventHandler(notifyIcon1_DoubleClick);
                
    this.notifyIcon1.Icon = new Icon("Virgo.ico");
                
    this.notifyIcon1.Visible = false;
            }

            
    void MainForm_SizeChanged(object sender, EventArgs e)
            {
                
    if (this.WindowState == FormWindowState.Minimized)
                {
                    
    this.ShowInTaskbar = false;
                    
    this.notifyIcon1.Visible = true;
                }
                
    else
                {
                    fws 
    = this.WindowState;
                }
            }

            
    void notifyIcon1_DoubleClick(object sender, EventArgs e)
            {
                
    if (this.WindowState == FormWindowState.Minimized)
                {
                    
    this.ShowInTaskbar = true;
                    
    this.notifyIcon1.Visible = false;
                    
    this.WindowState = fws;
                }
            }
        }
  • 相关阅读:
    androd Eclipse Ant 批量打包
    Eclipse中不显示Ant,如何操作
    android Eclipse 多渠道打包
    Android 关于tools
    (转)android studio 使用的主要操作
    Android的NDK开发步骤
    AnimatorSet中before与after的理解
    (转)Android webview 调用相机和照片库 实现文件的上传
    混淆的小记录
    Xamarin.Forms on WPF (Win7)
  • 原文地址:https://www.cnblogs.com/KenBlove/p/1281890.html
Copyright © 2020-2023  润新知