Results 1 to 3 of 3

Thread: align text in a message box

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,604
    Hey guys. has anybody else tried this? it doesn't work.
    strMessage = ""
    for x = 1 to 5
    strMessage = strMessage & vbCrLf & strArray(x)
    For y = 1 to (70 - Len(strArray(x)))
    strmessage = strMessage & " "
    Next y
    strMessage = strMessage & strArray2(x)
    Next x
    MsgBox(strMessage)

    What is this for? It should take these 2 arrays and make even columns out of them. But it doesn't. The number of characters in the first array aren't always the same width and so the second column is not aligned.

    Since I won't know what is going to print in this array, I can't "make" it line up.

    Any thoughts?


    Thanks
    wengang


    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    it works if u print it in the debug window....maybe there's a problem with the msgbox function???

    [Edited by rammy on 09-21-2000 at 04:33 AM]

  3. #3
    Guest
    It's bacause a msgbox uses a proportional font i.e. a "W" is wider than a "i"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width