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

📄 f3-5.frm

📁 VB课程教学的讲义源的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "例3-5"
   ClientHeight    =   3300
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3015
   LinkTopic       =   "Form1"
   ScaleHeight     =   3300
   ScaleWidth      =   3015
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text3 
      Alignment       =   2  'Center
      Height          =   390
      Left            =   840
      TabIndex        =   6
      Top             =   1560
      Width           =   1815
   End
   Begin VB.TextBox Text2 
      Alignment       =   2  'Center
      Height          =   390
      Left            =   840
      TabIndex        =   5
      Top             =   1080
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      Height          =   390
      Left            =   840
      TabIndex        =   4
      Top             =   600
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "计算面积"
      Default         =   -1  'True
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   2640
      Width           =   1695
   End
   Begin VB.Label Label5 
      Caption         =   "面积="
      Height          =   255
      Left            =   360
      TabIndex        =   8
      Top             =   2160
      Width           =   2295
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Caption         =   "请输入三角形的三个边长"
      Height          =   255
      Left            =   360
      TabIndex        =   7
      Top             =   240
      Width           =   2295
   End
   Begin VB.Label Label3 
      Caption         =   "C:"
      Height          =   255
      Left            =   360
      TabIndex        =   3
      Top             =   1680
      Width           =   375
   End
   Begin VB.Label Label2 
      Caption         =   "B:"
      Height          =   255
      Left            =   360
      TabIndex        =   2
      Top             =   1200
      Width           =   375
   End
   Begin VB.Label Label1 
      Caption         =   "A:"
      Height          =   255
      Left            =   360
      TabIndex        =   1
      Top             =   720
      Width           =   375
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
    Dim a!, b!, c!, p!, s!
    a = Val(Text1)  '把文本框中输入的数值赋给变量a
    b = Val(Text2)
    c = Val(Text3)
    p = (a + b + c) / 2
    s = Sqr(p * (p - a) * (p - b) * (p - c))
    Label5 = "面积=" & Str(s)     '在标签中显示面积
End Sub

⌨️ 快捷键说明

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