vb6 文本框回车键
怎样在VB中将文本框中的一句话从光标所在位置分成两行?按回车键分,并且分后第二行前面空两格。已经将文本框设为多行。我是这样写的代码,可总不正常。下面哪有问题?
Private Sub txtEdit_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
txtEdit.Text = txtEdit.Text & vbCrLf & " "
txtEdit.SelStart = Len(txtEdit.Text)
End If
End Sub
还有Len(txtEdit.Text)后要不要-1