用visual basic 6.0企业版编程的一个问题

2025-01-18 16:52:00
推荐回答(2个)
回答1:

代码如下,你在Text1中输入原字符串后按Command1按钮Text2中就出现与原字符串逆序的字符串:
Dim Str as String

Private Sub Form_Click()
Text1 = ""
Text2 = ""
End Sub

Private Sub Command1_Click()
Str = Text1
Text2 = StrReverse(Str)
End Sub

回答2:

'有很多方法可以实现,我列出其中一种,你参考一下

Private Sub Command1_Click()
Dim i As Integer
Dim l As Integer
l = Len(Text1.Text)
Text2.Text = ""
For i = 0 To l - 1
Text2.Text = Text2.Text + Mid(Text1.Text, l - i, 1)
Next
End Sub