English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I do not know how to cut a long sentence displayed in textboxes or msgboxes.

For example:
msgbox ("This is a very long sentence")

I want to place "long sentence." in next line, what expression is placed between

("This is a very

and

long sentence.").

O' thank you so much.

Worth '5 points' is waiting for those will answer me correctly right away. :-<>

2006-12-18 17:29:59 · 6 answers · asked by Teddie 3 in Computers & Internet Programming & Design

6 answers

Use Chr(10) & chr(13), or the constant vbcrlf, which is the same thing

Carriage Return and Line Feed

2006-12-18 17:40:46 · answer #1 · answered by Anonymous · 0 0

You use an event to trigger code that takes whats in the text boox and appends it into a text file. There are several events you can use so choosing which event to trigger one will depend on what you as a programmer and your users want to do. Some events to consider KeyUp KeyDown KeyPressed GotFocus LostFocus Validated TextChanged Other controls like a timer can be used to do a periodic save based upon a time limit. Save every 10 seconds for example. THese evets are good candidates to consider, which one you choose will depend on exactly how you want your program to work. EDIT: Depending upon which event you choose you can have unintended consequences such as triggering a save for each letter being entered. Consider typing "Hello" into a text box You intend to save "Hello" in a file. but if the event handler fires each time you enter a letter your text file could look like H He Hel Hell Hello OR H e l l o neither of these is what I suspect you intend

2016-05-23 06:28:18 · answer #2 · answered by Cheryl 4 · 0 0

You can use the visual basic constant variable vbCrLf

CrLf stands for Carriage Return, Line Feed

The constant variable needs to be added outside of the messagebox string so you will have to concatenate the text with the variable.

msgbox("This is a very" & vbCrLf & "long sentence")

Hope this helps.

2006-12-18 18:04:03 · answer #3 · answered by pgirl 1 · 0 0

Private SubCommand1_click( )
form1.print "This is a very"
form1.print "long sentence."
End Sub

I think if you replace form one with msgbox or textbox this should do the trick.

2006-12-18 18:19:46 · answer #4 · answered by Grev 4 · 0 0

Concatenate your sentence elements together with a vbCrLf
(Carrige Return Line Feed)

Mystr = "Beginning of sentence" & vbCrlf & "End of sentence"

2006-12-18 17:41:26 · answer #5 · answered by MarkG 7 · 1 0

Dim strMessage As String

strMessage = "This is a very" _
& vbNewLine _
& "long sentence"
MsgBox strMessage, , "Message Box"

2006-12-18 17:44:44 · answer #6 · answered by lv_consultant 7 · 0 0

fedest.com, questions and answers