Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Format a messagebox

Posted on 2004-03-26
3
Medium Priority
?
2,105 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
3 Comments
 
LVL 5

Accepted Solution

by:
Emanon_Consulting earned 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
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.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

926 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