-
October 13th, 2004, 06:45 AM
#1
AfxMessageBox: want other Font
Hi,
I need a bigger font in a (Afx-)MessageBox. Is this changeable?
Has anybody an idea?
Thanx
Thommy
-
October 13th, 2004, 07:08 AM
#2
Re: AfxMessageBox: want other Font
Originally Posted by ThommyTom
I need a bigger font in a (Afx-)MessageBox. Is this changeable?
Has anybody an idea?
Yes: The system font size, as used for message boxes, dialogs etc. is configurable by the user under Windows (via the control panel). Well behaved applications respect the users choice and use that font for message boxes (which is automatic anyway).
-
October 13th, 2004, 07:11 AM
#3
Re: AfxMessageBox: want other Font
Another option is to use a custom dialogue box for which you set the font.
Elrond
A chess genius is a human being who focuses vast, little-understood mental gifts and labors on an ultimately trivial human enterprise.
-- George Steiner
-
October 13th, 2004, 07:12 AM
#4
Re: AfxMessageBox: want other Font
The other choice you have is to write your own message box. I don't know your
needs, so it may or may not be worth the trouble.
//edit: or what Elrond said
Wakeup in the morning and kick the day in the teeth!! Or something like that.
"i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."
-
October 13th, 2004, 07:18 AM
#5
Re: AfxMessageBox: want other Font
Well roughly when you create messageboxes they use the system fonts. One work around is to just do your own message dialog.
HTH,
ahoodin
-
October 13th, 2004, 07:35 AM
#6
Re: AfxMessageBox: want other Font
You can intercept all your AfxMessageBox calls in one place see CWinApp:: DoMessageBox. You could put a custom dialog there.
-
October 13th, 2004, 09:13 AM
#7
Re: AfxMessageBox: want other Font
Originally Posted by ThommyTom
Hi,
I need a bigger font in a (Afx-)MessageBox. Is this changeable?
Has anybody an idea?
Thanx
Thommy
It is not so easy.... But nothing is impossible!
Take a look at this thread: http://www.codeguru.com/forum/showth...LLBACK+CBTProc
You could also find there a little sample projrct MessageFont.zip
Regards,
Victor
-
October 14th, 2004, 01:35 AM
#8
Re: AfxMessageBox: want other Font
Thank you all so far.
I hope that I not have to create my own dialog box ;-)
But the hint of Victor looks fine. I will check it as soon as possible (but regrettably don't have the time today..;-( )
Special hint: Enjoy live!!!!
Thommy
-
October 14th, 2004, 02:04 AM
#9
Re: AfxMessageBox: want other Font
Originally Posted by ThommyTom
I hope that I not have to create my own dialog box ;-)
Why? It's pretty straightforward, just a modal dialog box that you can draw with the resource editor.
However, seems as if you chose to ignore the fact that the font used in message boxes is a user choice (by the UI guidelines), and the system already provides a way for the user to change the font. The fact that there is no easy way to change the font of standard UI elements is not accidental - it's by design. Usually, when the API designers make something difficult to do, there's a good reason for it: It should be easy for developers to create conforming user interfaces, and hard to break the rules.
-
October 18th, 2004, 06:02 AM
#10
Re: AfxMessageBox: want other Font
[QUOTE=gstercken]Why? It's pretty straightforward, just a modal dialog box that you can draw with the resource editor.
QUOTE]
I don`t find it so easy, because you have to make all resizeable.
P.e.: If you give the Messagebox a long text with "/n" (line breaks), you have to resize the Edit-Field and the dialogbox itself.
Also different button combinations, icons,....
..ok, of course it's not impossible......but it takes a bit time (so why not to do it easier?... ) ;-))
Best regards
Thommy
-
October 19th, 2004, 06:18 AM
#11
Re: AfxMessageBox: want other Font
I understand that sometimes the need of a bigger font is there. But except for very important and exceptional messages, you should probably use the user settings, meaning that only rare cases should require you to use your own font. It should probably be easy enough to handle just a few cases for a custom dialogue.
Elrond
A chess genius is a human being who focuses vast, little-understood mental gifts and labors on an ultimately trivial human enterprise.
-- George Steiner
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|