Reputation: 1879
I wanted to change the MessageBox font in my .NET CF application and found that it's not that easy (and even impossible).
some adviced to change the default font of windows , cause MessageBox uses that.
the handy way is : Desktop properties/Appearance/Advanced...
but how can i do that by code using .NET class libraries?
there's a property that gets the system default font for messagebox:
SystemFonts.MessageBoxFont
but how to set it?
i tried calling SystemParametersInfo() win32 native function in Windows XP and it worked with SPI value SPI_SETNONCLIENTMETRICS.
but in Win CE 5.0 it returns error code 1439 / ERROR_INVALID_SPI_VALUE that means setting some values like font does is not supported.
i googled and just found THIS page that listed the SPIs for Windows CE 3.0 and my SPI to set current default message box is not there.
so how can i change Windows default font for message boxes?
Upvotes: 0
Views: 552
Reputation: 613461
I doubt that there is a supported way to change this from code. That's a system wide option that the user is in control of. MS likes to avoid tempting developers to change such settings.
Even if there is a way to change the system wide setting from code I urge you not to do so. Instead write your own message box dialog and feel free to use whatever font you like.
Upvotes: 1