CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: MsgBoxs

  1. #1
    Join Date
    May 2001
    Location
    Central USA
    Posts
    7

    MsgBoxs

    How can I make a msgbox multiline?
    like write something on one line and
    another on the next...?...

    Smile - somewhere its helping someone.

  2. #2
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: MsgBoxs

    MsgBox "this is line one" & vbNewLine & "this is line 2"

    David Paulson

  3. #3
    Join Date
    May 2001
    Location
    Central USA
    Posts
    7

    Re: MsgBoxs

    thank you sooooo much! is there a way to center text on a msgbox also?

    Smile - somewhere its helping someone.

  4. #4
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: MsgBoxs

    I whipped up a function for you

    option Explicit

    private Sub Form_Load()
    MsgBox CenterString("this is line one") & vbNewLine & CenterString("this is line 2")
    End Sub

    public Function CenterString(str as string) as string
    str = Space((25 - len(str)) / 2) & str & Space((25 - len(str)) / 2)
    CenterString = str
    End Function








    David Paulson

  5. #5
    Join Date
    May 2001
    Location
    Central USA
    Posts
    7

    Re: MsgBoxs

    thank you VERY much for ur help
    honestly tho, i dont think i will be able to use that because I havta do this proj for a school proj and im not sure we're allowed to use things we havent learned about and we havent learned about "Public ..." stuff....
    But thank you ever so much!!!

    Smile - somewhere its helping someone.

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

Featured