프로그래밍/C#

[C#] winform MessageBox Topmost로 띄우기

큐레이트 2023. 3. 6. 20:30
반응형

winform 개발 시 Topmost로 설정된 폼 위로 MessageBox를 Show해야되는 경우가 있을때 Topmost True로 Show를 안할 시 메세지 박스가 가려지기 때문에 프로그램이 멈춘 것 처럼 인식 되므로 아래의 구문처럼 메세지 박스를 호출 해야된다.

 

MessageBox.Show(new Form() { TopMost = true }, "TopMost MessageBox", "qratedev.tistory.com");

 

메서드 설명

MessageBox.Show 메서드 (System.Windows.Forms) | Microsoft Learn

 

MessageBox.Show 메서드 (System.Windows.Forms)

메시지 상자를 표시합니다.

learn.microsoft.com

 

반응형