【VB开源代码栏目提醒】:网学会员VB开源代码为您提供Ex2_11.frm参考,解决您在Ex2_11.frm学习中工作中的难题,参考学习。
VERSION 5.00
Begin VB.Form Ex2_11
Caption = "Form1"
ClientHeight = 1695
ClientLeft = 60
ClientTop = 450
ClientWidth = 4440
LinkTopic = "Form1"
ScaleHeight = 1695
ScaleWidth = 4440
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "取反"
Height = 375
Left = 3600
TabIndex = 4
Top = 480
Width = 735
End
Begin VB.TextBox Text2
Height = 375
Left = 1560
TabIndex = 3
Top = 840
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 2
Top = 360
Width = 1815
End
Begin
VB.Label Label2
Caption = "取反后字符串"
Height = 255
Left = 240
TabIndex = 1
Top = 960
Width = 1215
End
Begin VB.Label Label1
Caption = "取反前字符串"
Height = 255
Left = 240
TabIndex = 0
Top = 480
Width = 1215
End
End
Attribute VB_Name = "Ex2_11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Str1 As String, Str2 As String '定义两个字符串变量
Dim i As Integer '定义整型变量
Str1 = Text1.Text '获得用户输入的字符串
For i = 1 To Len(Str1) '将字符串取反
Str2 = Mid(Str1, i, 1) & Str2
Next i
Text2.Text = Str2 '在Text2中显示取反后的字符串
End Sub