Search code examples
vb.netpersistencemessagebox

MessageBox persistence in VB.net


I'm using MessageBox to give some information to the user, but when such a box pops up, I want it to block access to the main window. So, until the user has clicked "OK", they should not be able to click (or even focus on) the window that's below it.

Does anybody know how to do this? I've noticed that MessageBox has very few functions, so maybe I'll even have to use a different object for this.


Solution

  • Just after I posted here, my friend came up with the answer. By calling MessageBox.Show(mf, "text") where mf is the main form, mf will be disabled as long as the OK button has not been clicked. I suppose this question was a bit silly to post after all, but I hope it might help others if they're stuck with the same problem.