Frage

Ich verwende die MessageBox -Klasse, um den Benutzern Fehler anzuzeigen, und obwohl dies möglicherweise nicht das richtige Verhalten ist, ist es sehr bequem. Dies ist jedoch eine Touchscreen -Anwendung, daher brauche ich die Schaltfläche "OK", um viel größer zu sein als sie ist (verfluchen Sie meine übermäßig großen Finger!).

Ich denke, wenn ich die Schriftgröße im Dialogfeld erhöhe, sollte ich in Ordnung sein. Gibt es eine Möglichkeit, das zu tun? Oder gibt es wirklich eine Möglichkeit, die Dialoggröße zu erhöhen?

Vielen Dank

War es hilfreich?

Lösung

Soweit ich weiß, können Sie es nicht können, da die "normalen" Dialogfelder Ihre Standard -System -Schriftstellungen verwenden.

Roll Your Own ist wahrscheinlich der beste Weg nach vorne. Es ist ziemlich trivial und viel Spaß! Und Sie können Dinge einbauen, die der Standarddialog nicht unterstützt (ohne Pinvoke -Magie), z. B. Zentrum in der Mitte des Bildschirms usw.

Andere Tipps

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.

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.

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

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

Regards, Jörg

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top