728x90
반응형
MessageBox 를 이용해 메세지를 띄울때 그전에 띄워진 TopMost가 true인 창으로 인해 가려지는 경우가 있다.
가려지는 걸 막기 위해서는 MessageBox 를 띄울때 TopMost 를 true 로 처리해서 띄워야 하는데 이를 처리하는 방법은 아래와같다.
1.
using System.Windows;
MessageBox.Show("message.", "title", MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
MessageBoxOptions.DefaultDesktopOnly 항목이 TopMost=true 로 처리되게 해준다
2.
System.Windows.Forms.MessageBox.Show(new System.Windows.Forms.Form { TopMost = true }, "message", "title");
반응형
'C#' 카테고리의 다른 글
[C#] Visual Studio 2022 에서 Console.WriteLine 내용이 출력창에 나타나지 않을때 (0) | 2022.05.14 |
---|---|
[C#] ILSpay (ICSharpCode) 디컴파일러 (0) | 2022.05.11 |
[C#] MessageBox.Show TopMost true 로 띄우기 (0) | 2022.05.10 |
[C#] gRPC Stream Server/Client 만들기 (0) | 2022.05.04 |
[C#] gRPC Server/Client 만들기 (0) | 2022.05.04 |
[C#/Dapper] Multi Delete, Multi Update (0) | 2022.04.23 |