• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Where is "ENTER"?

## Recommended Posts

medovids    122
can somebody help me? I need to make a string in Visual Basic and it has to have multiple lines. Instead of the string saying "hello how are you" I want it to say "Hello how are you" How do I do this?

##### Share on other sites
Guest Anonymous Poster
you would insert vbCrLf where you want the line return:

str = "Hello" & vbCrLf & "how" & vbCrLf & "are" & "you"

medovids    122
Thanks!

##### Share on other sites
medovids    122
Is there any way to also right align the text?

##### Share on other sites
Peeper    122
Set the Align property of the control to rihgt. I don''t remember the actual numeric value, but it should show up in the drop down for the align property in the property viewer.

##### Share on other sites
medovids    122
How about in an MsgBox where there is no properties, Is right aligning text possible to do?

##### Share on other sites
Kippesoep    892
I haven''t done any VB programming, but the I would imagine it''s similar to the way it''s done in C. The MessageBox function has four parameters, the fourth specifying the type of message box through flags. One of the flags is MB_RIGHT, which should right-align your text.

So it should be something like:
  MessageBox (......, MB_RIGHT or MB_ICONQUESTION)