By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

Msgbox text font

P: n/a
Hi. I have Access 2003 and I am finding that the font in the text
displayed in Msgbox displays it too small. Is there anyway to increase
the font size of that text?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
Susan,
No, not without changing the OS desktop operating system appearance
settings.

A couple of suggestions;

1) Use uppercase bold characters. The bold switch is two @ signs
separated by a space at the end of the string, like this;

Msgbox UCase("This is my big bold message @ @")

-or-

2) Create a form that looks like a message box. That will give you
more control over the fonts in whatever text boxes you use. Make it
popup, modal, change the border style and remove the close box.

HTH.

Nov 13 '05 #2

P: n/a
Great ideas. Thanks.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3

P: n/a
"Susan Bricker" wrote
Great ideas. Thanks.


Another alternative is to create your own Form to use instead of the
standard MsgBox, so that you have control over these factors. That is often
done if you want the modal form to close itself after some period of time --
there's no MsgBox argument for that, but you can create a Form with a Timer
and Do It Yourself.

Larry Linson
Microsoft Access MVP
Nov 13 '05 #4

P: n/a
Lyn
"Wolf" <sp*************@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Susan,
No, not without changing the OS desktop operating system appearance
settings.

A couple of suggestions;

1) Use uppercase bold characters. The bold switch is two @ signs
separated by a space at the end of the string, like this;

Msgbox UCase("This is my big bold message @ @")

-or-

2) Create a form that looks like a message box. That will give you
more control over the fonts in whatever text boxes you use. Make it
popup, modal, change the border style and remove the close box.

HTH.


I hadn't heard of the "@ @" trick, so I tried it and it didn't work (A2003).

MsgBox Ucase("My message @ @")

resulted in a non-bold display of:

MY MESSAGE @ @

Am I missing something? (I used the immediate window if that is
significant.)

--
Cheers,
Lyn.
Nov 13 '05 #5

P: n/a
Susan Bricker wrote:
Hi. I have Access 2003 and I am finding that the font in the text
displayed in Msgbox displays it too small. Is there anyway to increase
the font size of that text?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***


Print Programming in Windows
Jeff Potts
R & D Books, Miller Freeman, Inc.
Lawrence, Kansas 66046
Copyright 2000
ISBN 0-87930-585-1

contains some very interesting ideas about using Windows API functions
to play with fonts. The handle to a window, to a Device Context and to
a font all seem to have wondrous possibilities. I became interested in
these techniques with the hopes of jazzing up the fonts in Access
reports since a user was complaining that she could export a query to
Excel and get the output to look better than an Access report.

An example from the book:
</StartQuote>
Declare Function TextOut Lib "gdi32" Alias "TextOutA" _
(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _
ByVal lpString As String, ByVal nCount As Long) As Long

There's not much to the routine. Both the x and y parameters specify
the location at which to place the text, the hdc parameter is the
destination device context, lpString is the string of text you want to
print, and cbString holds the number of characters you want to display.
Both the x and y parameters use the measurements specified by
SetMappingMode() when positioning the text. Since we are using the
default setting for coordinate mapping (MM_TEXT), everything will be
measured in device pixels. As with most API routines, a nonzero
indicates a successful call and a zero (or false) indicates some sort
of error. The most common error that could occur when calling this
routine is passing the function an invalid HDC.

....

(Visual Basic)
Sub PrintTextRandom(phdc As Long, hfont As Long, margins As RECT, _
x As Integer, y As Integer, str As String)
Dim oldfont As Long
Dim ret As Long

oldfont = SelectObject(phdc, hfont)
ret = TextOut(phdc, margins.left + x, margins.top, str, Len(str))
ret = SelectObject(phdc, oldfont)
End Sub

As you can see, this function is fairly simple. Basically, I select
the font into the HDC, print the text using TextOut(), and put the
previous font handle back into the HDC. With extensive printing of
text, this method of selecting of the font in-and-out of the HDC coud
degrade performance. On the other hand, it acts as a safeguard against
selecting an object into an HDC and forgetting to put it back. As
we've discussed previously, this is the fast-track to losing system
resources.
</EndQuote>

James A. Fortune

Nov 13 '05 #6

P: n/a
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).

Nov 13 '05 #7

P: n/a
Lyn
<ly******@yahoo.ca> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).

Still works in A2003. Thanks for that, I never knew it existed. Not sure
how/when I would use it either :-)

--
Cheers,
Lyn.
Nov 13 '05 #8

P: n/a

"Lyn" <lh******@iiNet.net.au> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
<ly******@yahoo.ca> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).

Still works in A2003. Thanks for that, I never knew it existed. Not sure
how/when I would use it either :-)


There's also what MichKa has at
http://www.trigeminal.com/usenet/usenet015.asp

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


Nov 13 '05 #9

P: n/a
Douglas J. Steele wrote:
"Lyn" <lh******@iiNet.net.au> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
<ly******@yahoo.ca> wrote in message
news:11**********************@z14g2000cwz.google groups.com...
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).


Still works in A2003. Thanks for that, I never knew it existed. Not sure
how/when I would use it either :-)

There's also what MichKa has at
http://www.trigeminal.com/usenet/usenet015.asp


And of course, good old Eval("Msgbox(""@@blah"")")

--
[OO=00=OO]
Nov 13 '05 #10

P: n/a

"Trevor Best" <no****@besty.org.uk> wrote in message
news:42**********************@news.zen.co.uk...
There's also what MichKa has at
http://www.trigeminal.com/usenet/usenet015.asp


And of course, good old Eval("Msgbox(""@@blah"")")


Which is, of course, the gist of MichKa's suggestion...

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


Nov 13 '05 #11

P: n/a
Lyn
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:hN********************@rogers.com...

"Lyn" <lh******@iiNet.net.au> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
<ly******@yahoo.ca> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).

Still works in A2003. Thanks for that, I never knew it existed. Not
sure how/when I would use it either :-)


There's also what MichKa has at
http://www.trigeminal.com/usenet/usenet015.asp

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

Interesting. I have had a bit of a play with both WizMsgBox and
FormattedMsgBox. If you use "@ @" in both, they seem to behave the same way
(text prior to the "@ @" in bold, then four line feeds to the remaining
text -- also a limit on the length of subsequent text). But using a single
"@" only works in FormattedMsgBox (text prior to the first "@" in bold, two
line feeds after each "@", but again with a limit to the total number of
lines).

On balance, FormattedMsgBox seems to be a bit more flexible.

--
Cheers,
Lyn.
Nov 13 '05 #12

P: n/a
ly******@yahoo.ca wrote:
@ @ stopped working somewhere around Access 2000.

It still works in the hidden and undocumented wizmsgbox procedure:

Public Sub blahblah()
With WizHook
.Key = 51488399
.WizMsgBox "Bold Line @ @ Not So Bold Line", _
"The Caption", vbYesNo, 23, "Path To Some Help File"
End With
End Sub

(tested in Access 2002).


What's the significance of the .Key property?

--
[OO=00=OO]
Nov 13 '05 #13

P: n/a
Lyn wrote:

Interesting. I have had a bit of a play with both WizMsgBox and
FormattedMsgBox. If you use "@ @" in both, they seem to behave the same way
(text prior to the "@ @" in bold, then four line feeds to the remaining
text -- also a limit on the length of subsequent text). But using a single
"@" only works in FormattedMsgBox (text prior to the first "@" in bold, two
line feeds after each "@", but again with a limit to the total number of
lines).

On balance, FormattedMsgBox seems to be a bit more flexible.


There is one drawback with both these methods and an extra bonus.

The bonus is that they support different alphabets, I use the Eval
method (as in Michka's FormattedMsgBox) to enable me to tell the Ruskis
they typed something in wrong :-) The standard (interaction.) msgbox
would display garbage when sent cyrillic text. (Well, actually I haven't
tested the Wizhook with a different alphabet)

The con is that the standard msgbox when displayed, you can hit Ctrl+C
and it copies the text of the messagebox, using the alternative ones,
this doesn't happen.

That functionality is useful for getting users to email me an error
message rather than having to copy it down manually (error prone) or
Alt-PrntScrn and send an image (some users have problems doing that).

Although I can look in their error logs to get the message (wading
through a load of them) it's just not as easy as them hitting Ctrl+C
then pasting that into an email.

--
[OO=00=OO]
Nov 13 '05 #14

P: n/a
It identifies the user as a wizard, thus permitting the subsequent call
of WizMsgBox.
Use
..Key = "Condola"
for witch.

Nov 13 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.