I fully agree.
But since you classified me as only capable of answering simple questions(which is all I do and can do in fact) I (with my simple mind) thought you where able to figure out all the rest for yourself. Correct me if I am wrong.:|
I should say: overide the Show method of the MessageBox class.
In the overide play the sound(async), then Show the messagebox.
according to this guy i cant override messagebox.show(), why?
This is old, nevertheless, you can create a derived MessageBox class, but the Show method of the MessageBox class is static. Therefore it's possible to override the MessageBox class, but you won't be able to override the Show method.
So, the following line will work.
public static MyMessageBox : MessageBox
but you won't be able to do this:
public static override MessageBoxResult Show( string messageBoxText )
Therefore, it is possible to override the messagebox class, but the one function that is acutally useful can not be overriden.
You could also just create a class called MessageBox in your application with static Show methods that match the framework MessageBox class. You could then use namespaces to switch between your MessageBox class and the framework MessageBox class.
public static MessageBox
public static MessageBoxResult Show( string messageBoxText )
return System.Windows.Forms.MessageBox.Show( messageBoxText );
Any of the other suggestions on this page should also suffice.