动作是:向text中输入字符串,以后回车。    请问:代码中如何识别当字符串中含有回车 (chr(13)),就提取回车以前的字符串?

解决方案 »

  1.   

    if(keyAscii=13) then
       '............
    end if
      

  2.   

    我做的事情就是,在text中添加内容,回车以后将添加的内容提取出来
      

  3.   

    Private Sub Command1_Click()
    Dim temp
    temp = Split(Text1.Text, vbCr)
    For i = 0 To UBound(temp) - 1
    Debug.Print temp(i) ' 第i+1 个回车前的字符穿串
    Next
    End Sub
      

  4.   

    if instr(1,text1.text,vbCr,vbTextcompare)>0 then
     debug.print left(text1.text,instr(1,text1.text,vbCr,vbTextcompare)-1)
    end if