MessageBox.Show— font change?

前端 未结 5 1967
一个人的身影
一个人的身影 2020-12-17 08:17

I\'m using the MessageBox class to show errors to users, and while that might not be the right behavior, it\'s very convenient. This is a touchscreen application, however,

相关标签:
5条回答
  • 2020-12-17 08:53

    There is a solution -- via installing CBT hook it is possible to adjust on the fly wide variety of MessageBox visual settings: message and button fonts, dialog background, dialog positioning, icons, button captions, timeout and so on.

    Extended MessageBox .NET Assembly http://www.news2news.com/vfp/?solution=5

    0 讨论(0)
  • 2020-12-17 08:54

    As far as I'm aware you can't, as the 'normal' dialog boxes are using your default system font settings.

    Roll your own is probably the best way forward. It's fairly trivial to do, and much fun! And you can build in things that the standard dialog doesn't support (without PInvoke magic) such as centering in the middle of the screen etc.

    0 讨论(0)
  • 2020-12-17 08:55

    Use a form with a Textbox and two Buttons OK, Cancel on it. Use this form instead of a MessageBox in the whole project. You can change the font, backColor, multiline etc of the textbox on the fly. You can change the size, color and font of the buttons too.

    0 讨论(0)
  • 2020-12-17 08:56

    I would create my own MessageBox class for this purpose - BigMessageBox perhaps?. It would then be a matter of replacing MessageBox.Show with BigMessageBox.Show.

    Another alternative is using windows hooks to modify the form - have a look at https://web.archive.org/web/20091208060754/http://msdn.microsoft.com/en-gb/magazine/cc188920.aspx for an example from .net 1.0. This may be easier in the current release, but I can't find an example for you.

    0 讨论(0)
  • 2020-12-17 09:01

    please check out my free to use FlexibleMessageBox which can be used instead of MessageBox and has a (static) FONT-Property.

    Regards, Jörg

    0 讨论(0)
提交回复
热议问题