Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Message box question

Message box question

Scheduled Pinned Locked Moved Visual Basic
helpquestion
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi! I would like to know if there is a way to 1) center your message in a message box 2) move down a line in the box (have part of the message on the first line, and a second part on the next) Thanks, any help would be breatly appreciated! Erin

    L P 3 Replies Last reply
    0
    • L Lost User

      Hi! I would like to know if there is a way to 1) center your message in a message box 2) move down a line in the box (have part of the message on the first line, and a second part on the next) Thanks, any help would be breatly appreciated! Erin

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2
      1. I do not believe that there are any settings to center the text in your message box. 2) You can add a newline character to your message to make the message skip to the next line. The newline is the chr(10) command. You can also add chr(9) in order to do a tab sequence.

      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      N 1 Reply Last reply
      0
      • L Lost User

        Hi! I would like to know if there is a way to 1) center your message in a message box 2) move down a line in the box (have part of the message on the first line, and a second part on the next) Thanks, any help would be breatly appreciated! Erin

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        In your string add CHR$(13) where you want the line to break. "line 1"+CHR$(13)+"line 2" There may be a newer syntax these days. As for centering, do you want each line centered or the overall message. If it is just the message, I believe centering is automatic. Don't know how to center each line.

        R 1 Reply Last reply
        0
        • P Paul M Watt
          1. I do not believe that there are any settings to center the text in your message box. 2) You can add a newline character to your message to make the message skip to the next line. The newline is the chr(10) command. You can also add chr(9) in order to do a tab sequence.

          Build a man a fire, and he will be warm for a day
          Light a man on fire, and he will be warm for the rest of his life!

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          kilowatt wrote: The newline is the chr(10) command 10 is line feed. I'd suggest a combination of 13 [carriage return] and 10 [line feed] Nish


          Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

          L P 2 Replies Last reply
          0
          • N Nish Nishant

            kilowatt wrote: The newline is the chr(10) command 10 is line feed. I'd suggest a combination of 13 [carriage return] and 10 [line feed] Nish


            Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            you've all been a great help! (i'm programming monopoly - insane amounts of code! :P) (for school)

            1 Reply Last reply
            0
            • L Lost User

              Hi! I would like to know if there is a way to 1) center your message in a message box 2) move down a line in the box (have part of the message on the first line, and a second part on the next) Thanks, any help would be breatly appreciated! Erin

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              In the properties window under justification click center

              N 1 Reply Last reply
              0
              • L Lost User

                In the properties window under justification click center

                N Offline
                N Offline
                Nick Parker
                wrote on last edited by
                #7

                Anonymous wrote: In the properties window under justification click center The MsgBox doesn't contain properties like you are talking about. Nick Parker

                1 Reply Last reply
                0
                • L Lost User

                  In your string add CHR$(13) where you want the line to break. "line 1"+CHR$(13)+"line 2" There may be a newer syntax these days. As for centering, do you want each line centered or the overall message. If it is just the message, I believe centering is automatic. Don't know how to center each line.

                  R Offline
                  R Offline
                  Rama Krishna Vavilala
                  wrote on last edited by
                  #8

                  Anonymous wrote: There may be a newer syntax these days. "Line 1" & vbCrLf & "line 2"

                  1 Reply Last reply
                  0
                  • N Nish Nishant

                    kilowatt wrote: The newline is the chr(10) command 10 is line feed. I'd suggest a combination of 13 [carriage return] and 10 [line feed] Nish


                    Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.

                    P Offline
                    P Offline
                    Paul M Watt
                    wrote on last edited by
                    #9

                    Just for your information, the message box and other window controls that display text ignore the carraige return, and since you need to type this in VB to get a carraige return: & chr(13) & I suggest to not use it at all. You do need a carraige return when you are dealing with files though.


                    Build a man a fire, and he will be warm for a day
                    Light a man on fire, and he will be warm for the rest of his life!

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups