2014-02-18 4 views
0

내 winform 응용 프로그램을 시스템 트레이에 최소화하려고 할 때 응용 프로그램을 최소화 할 때 시스템 트레이가 아니라 작업 표시 줄에서 열리고 잠시 후 자동으로 닫습니다. NotifyIcon 제어 및 등록이 추가되었습니다. Resize 이벤트 :내 winform 응용 프로그램을 시스템 트레이에 최소화

private void MainWin_Resize(object sender, EventArgs e) 
    { 
     if (FormWindowState.Minimized == this.WindowState) 
     { 
      notifyIcon1.Visible = true; 
      notifyIcon1.ShowBalloonTip(500); 
      this.Hide(); 
     } 
     else if (FormWindowState.Normal == this.WindowState) 
     { 
      notifyIcon1.Visible = false; 
     } 
    } 
+0

어떻게 그것을 해결하기 위해? (내가 쓴 글을 읽었습니까?) – user3271698

+0

http://stackoverflow.com/questions/1297028/having-the-application-minimize-to-the-system-tray-when-button-is-clicked – Akrem

+0

을 볼 수 있습니다. http://stackoverflow.com/questions/46918/whats-the-proper-way-to-minimize-to-tray-ac-sharp-winforms-app – Akrem

답변

2

이 시도 :

private void MainForm_Resize(object sender, EventArgs e) 
    { 
     switch (this.WindowState) 
     { 
      case FormWindowState.Maximized: 
       this.ShowInTaskbar = true; 
       break; 
      case FormWindowState.Minimized: 
       this.ShowInTaskbar = false; 
       break; 
      case FormWindowState.Normal: 
       this.ShowInTaskbar = true; 
       break; 
      default: 
       break; 
     } 
    } 
관련 문제