| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
- theme
- Gitea 설치
- 시놀로지깃티설치
- gitea설치
- Resident Evil
- Header
- CmdKey
- Re
- jellyfin
- 깃티
- unable to boot the simulator
- DataGridView
- 깃티설치
- 깃티gpg
- Gitea GPG
- Capcom
- checkbox
- c#
- 트레이아이콘
- toroisegit
- Resident
- gitea
- synology
- DataTable
- 젤리핀
- LogonUI
- gfd
- 시놀로지
- Column
- trayicon
- Today
- Total
C O D I N G
TrayIcon 좌클릭, 우클릭 메뉴 가능하게 하기 본문
TrayIcon에서
우클릭했을떄랑, 좌클릭했을때 ContextMenu를 다르게 보는 방법
private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
System.Reflection.MethodInfo methodInfo =
typeof(NotifyIcon).GetMethod("ShowContextMenu",
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic);
methodInfo.Invoke(notifyIcon1, null);
}
else if (e.Button == MouseButtons.Right)
{
notifyIcon1.ContextMenuStrip = contextMenuStrip2;
System.Reflection.MethodInfo methodInfo =
typeof(NotifyIcon).GetMethod("ShowContextMenu",
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic);
methodInfo.Invoke(notifyIcon1, null);
}
}
코드에 관한 설명 - 질문자 우시와카는 본인임.
http://www.hoons.net/Board/QACSHAP/Content/31613?Key=Name&Value=%EC%9A%B0%EC%8B%9C%EC%99%80%EC%B9%B4
'Programming > C#' 카테고리의 다른 글
| DataTable 사용방법 (0) | 2016.08.14 |
|---|---|
| ComboBox에 항목별로 Tag를 사용하는 방법 (DataTable) (0) | 2016.08.14 |
| xml Element (0) | 2016.08.02 |
| 메시지박스 자동 종료하기 (0) | 2016.04.24 |
| DataGridView RowHeader에 숫자 넣는법 (0) | 2016.02.26 |