NotifyIcon
및 ContextMenuStrip
을 드래그 앤 드롭하십시오. 것과
- 설정 드 NotifyIcon의 컨텍스트 메뉴 당신은
- (예, 출구 복원)
는 양식 이벤트 resize
설정이 메뉴 아이템을 추가하고 들어 다음과 같은 체크
private void MyForm_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized) this.Hide();
else this.Show();
}
// you could also restore the window with a
// double click on the notify icon
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
}
을 추가 예를 다운로드 할 수 있습니다 this project
오른쪽 클릭 이벤트에 대해 걱정하지 마십시오. NotifyIcon
은 au 그것을 자동으로 감지하고 보여라. ContextMenu
이 답을 점검해라. http://stackoverflow.com/questions/46918/whats-the-properway-to-minimize-to-tray-ac-winforms-app/47743#47743 관련 질문에서. –