MsgBox formatting.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have about 20 MsgBox occurance in by program, which I use to inform the
user of the progress of the program, or ask confirmation of an action, or
simply to act separators to various parts of the program.

They all vary in size and shape depending on the text length.

To make the looks of the program more consistant, I made the FIRST and LAST
line a series of "======" 65 characters long.

Windows displays Message Box text using a font defined by the user's
"Appearance" settings, and most users probably have the default Tacoma 8pt
or some other proportional space font installed.

l loaded the text into Word and centered each line of text to the length of
the top and bottom lines by padding each line with leading blank spaces.

I then pasted each line, including the spaces, between the quotes framing my
text in the MsgBox code.

Now all msgboxes displayed the same width, and each line of text is
centered and looks great! .


One of my beta testers had set his display to use "Large Fonts" and both
of the ===== lines wrapped onto the next line as did the longest line
of text.

Is there any way to format the text in a MsgBox so that it uses a font and
font size of my choosing, instead of the user's system preferences.


Alternately, is there any way to know the maximum size line that will not be
wrapped in any screen resolution and font size.

........joisey
 
Joisey,
Is there any way to format the text in a MsgBox so that it uses a font and
font size of my choosing, instead of the user's system preferences.

I would recommend creating a custom form that appears similar to a Message
box, yet allows you to control the font, size & centered text. You could
also include rules (lines) on the form rather then attempt to fake them with
a string of equal signs or hyphens...

As MessageBox itself was designed to display "simple" text left justified in
a proportional font.

Hope this helps
Jay
 
Is there a simple way to capture the destination machines screen
chracteristics?

Particulary, to find ouf if the DpI stetting in Properties>Settings>advanced
set to large fonts(120dpi) or normal(96dpi).

Is there a simple way to capture the font and size the user's machine has
set for diplay of message boxes.

If my program "Knew" this, it could adjust line length and centering "on the
fly"

I know I could design forms to replace the message boxes, but there are
about 20 of them, this problem of bad formatting when a user has large fonts
just came up, and the product is due to go comercial this weekend,. I have
limited time since I still have a 10 hr day job.

.....joisey







I have about 20 MsgBox occurance in by program, which I use to inform the
user of the progress of the program, or ask confirmation of an action, or
simply to act separators to various parts of the program.

They all vary in size and shape depending on the text length.

To make the looks of the program more consistant, I made the FIRST and
LAST
line a series of "======" 65 characters long.

Windows displays Message Box text using a font defined by the user's
"Appearance" settings, and most users probably have the default Tacoma 8pt
or some other proportional space font installed.

l loaded the text into Word and centered each line of text to the length
of
the top and bottom lines by padding each line with leading blank spaces.

I then pasted each line, including the spaces, between the quotes framing
my
text in the MsgBox code.

Now all msgboxes displayed the same width, and each line of text is
centered and looks great! .


One of my beta testers had set his display to use "Large Fonts" and both
of the ===== lines wrapped onto the next line as did the longest line
of text.

Is there any way to format the text in a MsgBox so that it uses a font and
font size of my choosing, instead of the user's system preferences.


Alternately, is there any way to know the maximum size line that will not
be
 
Joisey,
My suggestion was to design a single form to replace the single MessageBox
form.

Your single form would look at the size of the text & adjust the size of the
form appropriately.

This single MessageBox replacement form should be little more then a Form, 3
buttons, a PictureBox, and a Label. Plus code to set the various controls
appropriately.

I used a MessageBox replacement in one project that used a Grid to display
the list of Errors that ADO returns...

I will see about creating a simplier sample later today.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top