C# Minimize to system tray on close

前端 未结 7 1145
再見小時候
再見小時候 2020-12-28 09:10

Hi In my c# application I am trying to minimize application to systems tray, when the form is closed. Here is the code I have tried.

   public void MinimizeT         


        
7条回答
  •  悲哀的现实
    2020-12-28 09:20

    You need to use the FormClosing-Event.

    private void Form1_FormClosing(Object sender, FormClosingEventArgs e) {
        e.Cancel = true;
        MinimizeToTray();
    }
    

提交回复
热议问题