一.交换对象
1点击“CommandButton”按钮,再在右侧Form1中空白区域选择大小适宜的区域,出现按钮型图标后,选中图标,将表格中“Caption”后面的“Command1”改成“变换”。
2双击按钮型图标,输入如下.
Cls
Dim a AsInteger,b As Integer,c As Integer
a=-1:b=2
Print"a="&a
Print "b="&b
c=a
a=b
b=c
Print "a="&a
Print "b="&b
二.交换对象
1点击“Label”按钮,再在右侧Form1中空白区域选择大小适宜的区域,出现闹钟图标后,选中图标,在右下角,将表格中“Caption”后面的“Label1”改成“红糖”,“Forecolor”后面的颜色在调色版中改成红色,“Backcolor”后面的颜色在调色版中改成黑色,单击“Font”属性右侧的…按钮,在对话框中将字体设置为一号字、加粗。
2点击“Label”按钮,再在右侧Form1中空白区域选择大小适宜的区域,出现闹钟图标后,选中图标,在右下角,将表格中“Caption”后面的“Label2”改成“白糖”,“Forecolor”后面的颜色在调色版中改成白色,“Backcolor”后面的颜色在调色版中改成黑色,单击“Font”属性右侧的…按钮,在对话框中将字体设置为一号字、加粗。
3点击“CommandButton”按钮,在右侧Form1中空白区域选择大小适宜的区域,出现按钮型图标后,选中图标,将表格中“Caption”后面的“Command1”改成“变换”,
4双击按钮型图标,输入如下.
Dima As String
a=Me.Label1.Caption
Me.Label1.Caption=Me.Label2.Caption
Me.Label2.Caption=a
Dimb As String
b=Me.Label1.Forecolor
Me.Label1.Forecolor=Me.Label2.Forecolor
Me.Label2.Forecolor=b