| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 | 31 |
- gfd
- 시놀로지깃티설치
- Column
- Gitea 설치
- CmdKey
- theme
- DataGridView
- unable to boot the simulator
- synology
- Header
- Re
- 트레이아이콘
- Capcom
- gitea설치
- 시놀로지
- checkbox
- Resident Evil
- jellyfin
- trayicon
- 깃티설치
- toroisegit
- c#
- Resident
- 젤리핀
- DataTable
- 깃티gpg
- LogonUI
- Gitea GPG
- gitea
- 깃티
- 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 |