VB6 InputBox是否支持多行字符串?

问题描述 投票:2回答:1

在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")
vb6
1个回答
0
投票

不,不是真的。 IIRC,InputBox should保留通过粘贴放入其中或通过ALT + ###输入的所有换行符。但是,它们将在框中显示为空格。它只会出现在一行上。没有使用InputBox让用户输入多行的真正方法。

处理此问题的最具功能的方法是创建一个自定义表单,并使用它来收集用户输入。您可以将其设置为模态对话框,以强制用户与其进行交互,类似于InputBox。有几种方法可以将输入传递回显示表单的过程(例如,使用全局变量)。

© www.soinside.com 2019 - 2024. All rights reserved.