⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 交换两个数.frm

📁 vb 程序基础设计与编程对初学者会有很大帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "交换两个数"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.PictureBox Picture1 
      Height          =   975
      Left            =   1800
      ScaleHeight     =   915
      ScaleWidth      =   1155
      TabIndex        =   6
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "交换"
      Height          =   495
      Left            =   3360
      TabIndex        =   4
      Top             =   600
      Width           =   975
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1800
      TabIndex        =   3
      Top             =   960
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1800
      TabIndex        =   2
      Top             =   120
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "交换的结果"
      Height          =   375
      Left            =   360
      TabIndex        =   5
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "输入第二个数b"
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   1080
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "输入第一个数a"
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub swap(x As Integer, y As Integer)
  Dim t As Integer
  t = x
  x = y
  y = t
End Sub

Private Sub Command1_Click()
  Dim a As Integer, b As Integer
  a = Text1.Text
  b = Text2.Text
  swap a, b
  Picture1.Print "a="; a
  Picture1.Print "b="; b
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -