Solved

Format a messagebox

Posted on 2004-03-26
3
2,091 Views
Last Modified: 2010-05-18
How do I change the format of the text of my messagebox?  Can I change the font size and make it bold?  What does the code look like to do this?
Thanks.
0
Comment
Question by:pmcelhany
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
Emanon_Consulting earned 125 total points
ID: 10692451
Hi pmcelhany,

It is my understanding that you can not format the size or bold the font in a messagebox.  You can format dates, times, numbers, to display "mmm dd, yyyy" or "##,##0.00" etc.  You can only format the text to be Upper/Lower case using...

MyStr = Format("HELLO", "<")    ' Returns "hello".
MyStr = Format("This is it", ">")    ' Returns "THIS IS IT".
message box example
MsgBox Format("You must select a Date first", ">"), vbInformation, "Report Criteria Missing"
This would be silly of course because you would just type the message all in caps instead of formatting it.

However...
If you create your own msgbox using a form then you have complete control over size, bold, color, etc.  But I believe this is the only way.
If you know what the message box is going to read and you want it custom formatted, then make your own in a form.  You can give it 'Pop Up' and 'Modal' formats as well which will force the User to respond to your message box before being able to continue.

Hope that helps...
Cheers
M
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10698122
The approach to take is what Emanon_Consulting has said

you will have to create your own form if you want to format text within a textbox

as with any form, you can pass it with arguments so that you can have different text appearing each time you call it.
If you do that, it would be better to create a module say MyMessageBox which takes in a string (plus other parameters if you wish to), this module would then call the form. If later on you decide to change this, you simply need to modify thje module MyMessageBox

the only tailoring you can do with a message box is the buttons, you can add in optional graphics with a choice of buttons
0
 

Author Comment

by:pmcelhany
ID: 10705119
Thanks for the help.  At least now I can tell the user to try something else.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question