A multiline MessageBox?

This is a discussion on A multiline MessageBox? within the C++ Programming forums, part of the General Programming Boards category; In Visual Basic, you can create a multi-line message box like this: Dim iReturn As Integer iReturn = MsgBox("This is ...

  1. #1
    Unregistered
    Guest

    A multiline MessageBox?

    In Visual Basic, you can create a multi-line message box like this:

    Dim iReturn As Integer

    iReturn = MsgBox("This is the first line" & vbCr & "This is the second. Isn't that cool?", vbQuestion + vbYesNo, "Multi-line MessageBox")

    you'd get a message box with an exclamation point icon, two lines of text and a title of "Multi-line MessageBox" - which would return 6 for yes, 7 for no (vbYes or vbNo if you like constants).

    How would I implement this in C++? I can get a single line messagebox and it's return value no problem... but I have two things to put in it and it makes the box too big to put on one line.

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    31
    Ok, I screwed up... but I can't edit because I accidentally posted anonymously...

    but where I said you'd get a message box with an exclamation point icon...

    I really meant a question mark...

    but the question still stands: Can you have a multiline MessageBox?
    Welcome to the funhouse, where strange mirrors reflect the faces of insanity.

  3. #3
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    This should probably go in the windows programming section.

  4. #4
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    I think it will be like this:
    MessageBox("This is the first line\nThis is the second line\n....");

    Hope it works
    Ammar...

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by XenoCodex Admin
    Ok, I screwed up... but I can't edit because I accidentally posted anonymously...

    but where I said you'd get a message box with an exclamation point icon...

    I really meant a question mark...

    but the question still stands: Can you have a multiline MessageBox?
    Multiline MessageBox with Question Mark?

    MessageBox(HWND_DESKTOP,"Line1\nLine2\nLine3","Cap tion", MB_ICONQUESTION);

  6. #6
    Registered User
    Join Date
    Jun 2002
    Posts
    31
    Ah, thanks. I forgot about the newline characters.
    Welcome to the funhouse, where strange mirrors reflect the faces of insanity.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Delete files that are used
    By Yuri in forum C++ Programming
    Replies: 8
    Last Post: 10-18-2005, 01:48 PM
  2. problem with A simple modeless messagebox
    By hanhao in forum C++ Programming
    Replies: 8
    Last Post: 07-05-2005, 11:18 PM
  3. MessageBox problem
    By jjolly in forum Windows Programming
    Replies: 6
    Last Post: 06-23-2003, 12:07 AM
  4. EnterCriticalSection and MessageBox
    By novacain in forum Windows Programming
    Replies: 13
    Last Post: 01-30-2003, 07:48 AM
  5. double in a MessageBox
    By Robert602 in forum Windows Programming
    Replies: 3
    Last Post: 12-17-2001, 02:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21