Centre text in an MsgBox call

  • Thread starter Thread starter Duncan Edment
  • Start date Start date
D

Duncan Edment

Is it possible? If so, how?

Or, would I be better writing my own code to create a window, with the text
centred in it? If so, how do I get the window to have the functionality--i.e.
warning, exclamation icons etc.--that the MsgBox function has?

Your help / advice is, as always, appreciated.

Regards

Duncan
 
No way I know to center the message in a message box. If that's what you
want, then do as you suggest: build your own message box form so that you
can control the appearance, etc.
 
Can you determine, by trial and error (or in help
resources?),the width of the part of the msgbox the text
is in and then create a string of centered multiline
text, with preceding and trailing spaces for each line of
text in the box, using vbcrlf in your string to force
separate lines?
 
I kinda guessed that's what I'd have to do Ken. However, do you have any idea
if / how I can get the exclamation / warning icons etc. that MsgBox has? Can
the VB constants be used on a normal form, as well as MsgBox?

Duncan
 
No, the vb constants don't work in the form.... let me check with some
others to see how you might utilize the "icons" on the form as an image and
I'll get back to you.
 
This website has some icon/gif downloads that appear to contain these (and
many, many other) such pictures. You would need to put an image control on
your form and then assign the appropriate image to it as needed.

Download the IconsAndGifs zip file at
http://ffdba.com/downloads.htm
 
Back
Top