Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msgbox - centralise text

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
is there a way to have the text central in a message box?

"My God! It's full of stars...
 
As in "centered" ???

You can manually center the text before sending it to the message box
Code:
    Dim TheMessage                  As String
    Dim PadSpaces                   As Long
    TheMessage = "Test String"
    PadSpaces = (100 - Len(TheMessage)) \ 2
    TheMessage = Space(PadSpaces) & TheMessage & Space(PadSpaces)
    MsgBox TheMessage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top