7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Text1_Click()
Dim s$, ss$, n&, s1$, s2$
s = Form1.Text1.Text
n = Form1.Text1.SelStart
s1 = Left(s, n): s2 = Mid(s, n + 1)
ss = Mid(s1, InStrRev(s1, Space(1)) + 1) & Left(s2, IIf(InStr(s2, Space(1)) = 0, Len(s2), InStr(s2, Space(1)) - 1))
Form1.Text2.Text = Form1.Text2.Text & ss & Space(1)
End Sub
Private Sub Text1_Click()
Dim s$, ss$, n&, s1$, s2$
s = Form1.Text1.Text
n = Form1.Text1.SelStart
s1 = Left(s, n): s2 = Mid(s, n + 1)
ss = Mid(s1, InStrRev(s1, Space(1)) + 1) & Left(s2, InStr(s2, Space(1)) - 1)
Form1.Text2.Text = Form1.Text2.Text & ss & Space(1)
End Sub
Private Sub Text1_Click()
Dim posR As Integer, posL As Integer
Dim strTmp As String
If Text1.SelStart = 0 Then Text1.SelStart = 1
posR = Text1.SelStart + 1
posL = Text1.SelStart
Do Until Mid(Text1.Text, posR, 1) = " "
strTmp = strTmp & Mid(Text1.Text, posR, 1)
posR = posR + 1
If posR > Len(Text1.Text) Then Exit Do
Loop
If posL > 0 Then
Do Until Mid(Text1.Text, posL, 1) = " "
If posL > 0 Then
strTmp = Mid(Text1.Text, posL, 1) & strTmp
posL = posL - 1
End If
If posL = 0 Then Exit Do
Loop
End If
Text2.Text = Text2.Text & IIf(Text2.Text = "", strTmp, " " & strTmp)
End Sub