在Visual Basic 6中使用InputBox时,我可以输入多行字符串吗?
strSrch = InputBox("Enter word(s) or phrase(s), like " & Chr(34) & "Jesus wept" & _
Chr(34) & " to search for any word or phrase" & vbCrLf & _
"If you place & between words the verse must contain both words, loved & world" & _
vbCrLf & "or both phrases, " & Chr(34) & "keep the commandments" & Chr(34) & _
" & " & Chr(34) & "of Jesus" & Chr(34) & vbCrLf & "Put ! in front of a word or phrase to exclude it from your search, Jesus ! testimony" & _
vbCrLf & "Use( before and ) after expressions to group them together, (" & Chr(34) & _
"Come unto me" & Chr(34) & " & all)" & vbCrLf & "Use Xor between two words to include one or the other but not both, " & _
Chr(34) & "I am" & Chr(34) & " Xor that", "Word Search")
不,不是真的。IIRC,InputBox应保留通过粘贴或通过ALT+###输入的任何换行符。但是,它们将在框中显示为空格。它只会出现在一行。没有真正的方法可以使用InputBox让用户输入多行。
处理这一问题的最具功能的方法是创建一个自定义表单并使用它来收集用户输入。您可以将其设置为模式对话框,以强制用户与之交互,类似于InputBox。有几种方法可以将输入传递回显示表单的过程(例如使用全局变量(。