1.首先,打开VB程序 2.然后在左侧工具栏中找到command button的图标,并在Form1的右下角适当大小的创建。 3.在属性窗口中找到capition并将它后面“Command1”改为“交换”。 4.在窗体中双击“交换”,并在弹出的对话框中输入以下内容 Cls Dim b As Integer Dim c As Integer Dim d As Integer c = Int(Rnd() * 1000) b = Int(Rnd() * 1000) Print "b" & b Print "c" & c d = c c = b b = d Print "b" & b Print "c" & c 5.在上方工具栏中点击启动按钮,运行程序。