Search code examples
c#vb.netmessageboxmsgboxtopmost

MessageBox Top Most True


is there way to make the default messagebox ( MessageBox.Show() ) TopMost true which also stays on top even if the messagebox lost the focus? I don't want to create a custom one. Is there a way doing it by using SetWindowHook or something similar? I already researched a lot but all solutions I found were not working. Can someone help me out how to do this in VB.net or C#?


Solution

  • The simplest way is to p/invoke the MessageBox function and pass the MB_SYSTEMMODAL flag.