practice4_7.frm

来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 116 行

FRM
116
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "求两点之间的距离"
   ClientHeight    =   2265
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4035
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   14.25
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   2265
   ScaleWidth      =   4035
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command1 
      Caption         =   "距离="
      Height          =   495
      Left            =   240
      TabIndex        =   9
      Top             =   1440
      Width           =   975
   End
   Begin VB.TextBox Text4 
      Height          =   405
      Left            =   2640
      TabIndex        =   7
      Top             =   840
      Width           =   855
   End
   Begin VB.TextBox Text3 
      Height          =   405
      Left            =   960
      TabIndex        =   5
      Top             =   840
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   405
      Left            =   2640
      TabIndex        =   3
      Top             =   120
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   405
      Left            =   960
      TabIndex        =   1
      Top             =   120
      Width           =   855
   End
   Begin VB.Label Label6 
      BorderStyle     =   1  'Fixed Single
      Height          =   495
      Left            =   1440
      TabIndex        =   8
      Top             =   1440
      Width           =   2055
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "Y2="
      Height          =   285
      Left            =   2160
      TabIndex        =   6
      Top             =   900
      Width           =   450
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "X2="
      Height          =   285
      Left            =   480
      TabIndex        =   4
      Top             =   900
      Width           =   450
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Y1="
      Height          =   285
      Left            =   2160
      TabIndex        =   2
      Top             =   180
      Width           =   450
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "X1="
      Height          =   285
      Left            =   480
      TabIndex        =   0
      Top             =   180
      Width           =   450
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
   X1 = Val(Text1.Text)
   Y1 = Val(Text2.Text)
   X2 = Val(Text3.Text)
   Y2 = Val(Text4.Text)
   distance = Sqr((X2 - X1) ^ 2 + (Y2 - Y1) ^ 2)
   Label6.Caption = Format(distance, "0.0000")
End Sub

⌨️ 快捷键说明

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