Display a message box in a cross-platform manor


For background, I am currently writing an OpenTK app that should show a message box if an error occurs. Usually on Windows-only apps this is easily done with Winforms, but I would like this to work on not just Windows, but Linux and Mac as well. So far, my search for potential solutions has not turned up anything useful to my use case.

I’d prefer to stay away from full UI libraries if possible as to make my app as light as possible. I just want it to use the system-native message box.

Are there any existing libraries that can do this? If there aren’t, then how could I go about writing my own implementation, if possible?


I recently learned of SDL2-CS, which allows me to use SDL 2 in my application. I was previously unaware of what SDL did for applications, but I have since replaced the OpenTK windowing code with SDL 2 code via SDL2-CS. I am now also able to create message boxes as desired by using SDL_ShowSimpleMessageBox().

Answered By – AyesC

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published