| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- Gitea GPG
- CmdKey
- Resident
- gfd
- 트레이아이콘
- 깃티gpg
- LogonUI
- 깃티설치
- c#
- trayicon
- theme
- DataTable
- Header
- Column
- 깃티
- Resident Evil
- Gitea 설치
- 시놀로지깃티설치
- synology
- Capcom
- toroisegit
- 시놀로지
- checkbox
- 젤리핀
- gitea
- unable to boot the simulator
- jellyfin
- Re
- DataGridView
- gitea설치
Archives
- Today
- Total
C O D I N G
메시지박스 자동 종료하기 본문
종료버튼 눌렀을 때 메시지 박스가 뜨면,
1000ms(1s)후에 자동 종료되는 형태이다.
다른 방법도 있지만 Action으로 사용 하는 방법
private void MessageBoxFormClosing(Form fm) { if (fm.InvokeRequired) { Action<Form> closeform = new Action<Form>(MessageBoxFormClosing); this.Invoke(closeform, fm); } else { if (fm != null) fm.Close(); } } private void button1_Click(object sender, EventArgs e) { Form msgfm = new Form(); Action clse = new Action(() = > { while (true) { System.Threading.Thread.Sleep(1000); break; } MessageBoxFormClosing(msgfm); }); clse.BeginInvoke(ir = > clse.EndInvoke(ir), null); MessageBox.Show(msgfm, "닫혀~"); }
'Programming > C#' 카테고리의 다른 글
| DataTable 사용방법 (0) | 2016.08.14 |
|---|---|
| ComboBox에 항목별로 Tag를 사용하는 방법 (DataTable) (0) | 2016.08.14 |
| xml Element (0) | 2016.08.02 |
| TrayIcon 좌클릭, 우클릭 메뉴 가능하게 하기 (0) | 2016.04.25 |
| DataGridView RowHeader에 숫자 넣는법 (0) | 2016.02.26 |