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

MsgBox formatting.

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

<jo****@mindspring.com> wrote in message
news:Os****************@TK2MSFTNGP10.phx.gbl...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

Nov 21 '05 #2

P: n/a
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



<jo****@mindspring.com> wrote in message
news:<Os**************@TK2MSFTNGP10.phx.gbl>...
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
<jo****@mindspring.com> wrote in message
news:Os****************@TK2MSFTNGP10.phx.gbl...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

Nov 21 '05 #3

P: n/a
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

<jo****@mindspring.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
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



<jo****@mindspring.com> wrote in message
news:<Os**************@TK2MSFTNGP10.phx.gbl>...
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



<jo****@mindspring.com> wrote in message
news:Os****************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #4

P: n/a
Joisey,
Here is a recent post on www.codeproject.com that describes "what goes into
creating a message box"

The sample is in C#, however it should be usable as is, or easily converted
to VB.NET.

http://www.codeproject.com/cs/miscctrl/MessageBoxEx.asp

The added advantage of MessageBoxEx is it allows you to add "questions"
(checkboxes) to the Message Box displayed.

Hope this helps
Jay
<jo****@mindspring.com> wrote in message
news:uz**************@TK2MSFTNGP10.phx.gbl...
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



<jo****@mindspring.com> wrote in message
news:<Os**************@TK2MSFTNGP10.phx.gbl>...
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



<jo****@mindspring.com> wrote in message
news:Os****************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.