Centre text in an MsgBox call

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
 
K

Ken Snell

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.
 
G

Guest

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?
 
P

Paul Hughes

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
 
K

Ken Snell

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.
 
K

Ken Snell

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
 

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

Top