VB,怎样将文本框1中的"健康身体"那行显示在文本框2中?

来源:百度知道 编辑:UC知道 时间:2024/05/30 16:10:02

Private Sub Command1_Click()
Dim a as string
a = Split(Text1, vbCrLf)
Text2 = ""
For i = 0 To UBound(a) ’这样修改才能读取第一行有 健康身体
If InStr(a(i), "健康身体") Then Text2 = Text2 & a(i) & vbCrLf
Next i
End Sub

dim a
a=split(text1,vbcrlf)
text2=""
for i=1 to ubound(a)
if instr(a(i),"健康身体") then
text2=a(i)
exit for
next i