MsgBox msg on multiple lines.. How?

Ironis

Learning Member...
Local time
Today, 07:19
Joined
Oct 10, 2002
Messages
61
Sorry, 3rd question this hour, but I need the answer ;)

I have a few MsgBoxes, and I want the text to be on multiple lines. How can I do that? I know it can be done, but I don't know how.

This is the code I have on one of the textboxes:

PHP:
    Msg1 = "There are " & spce & " spaces available." & _
            " There are " & enc & " Encounters and " & swim & " Swims. " & _
            "Please try another day or time."

Please help me out :)
 
Try stickignthis into it

vbcrlf

(Visual Basic Carriage Return Line Feed)

you can also use (I think) Chr(10) & Chr(13) which is exaclty the same thing
 
Ok, tnx it works,
Now is there also a command that you can align the text to the center of the MsgBox? Or do I just have to fill in spaces or something like that?
 
Ironis,

By default the text is left justified.

As far as I know, the only other option is to right justify it
with vbMsgBoxRight.

You could use the space function and/or tabs to center it
yourself.

Wayne
 
You will need to use space,space,space to align to the centre.
Painfully slow I found.
A quicker way is to open the Immediate window (Ctl + G) and type - or copy the msgbox code there. When the cursur is at the end of the line, hitting enter will bring up the msgbox so you can have a look. Saves having to go back to your form and trigger the event that displays the msgbox.
Once you are happy with it, copy the line back into your code.
HTH
Dave
 
Last edited:
cool, thanks. That sounds much easier then opening the form, retrigering the event and blabla...
Thanks fo the tip (btw: maybe a good tip to microsoft, to add vbMsgBoxCenter or something like that ;) )
 

Users who are viewing this thread

Back
Top Bottom