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

📄 form0803.frm

📁 VB实验教程源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "绘制矩形"
   ClientHeight    =   2400
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4185
   LinkTopic       =   "Form1"
   ScaleHeight     =   2400
   ScaleWidth      =   4185
   StartUpPosition =   3  '窗口缺省
   Begin VB.PictureBox Picture1 
      Height          =   1695
      Left            =   2160
      ScaleHeight     =   1635
      ScaleWidth      =   1635
      TabIndex        =   6
      Top             =   360
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Height          =   1815
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   1455
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   720
         TabIndex        =   5
         Top             =   720
         Width           =   495
      End
      Begin VB.CommandButton Command1 
         Caption         =   "画图"
         Height          =   375
         Left            =   240
         TabIndex        =   4
         Top             =   1200
         Width           =   975
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   720
         TabIndex        =   1
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label2 
         Caption         =   "宽="
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label1 
         Caption         =   "长="
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   240
         Width           =   375
      End
   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 W As Integer, H As Integer
    W = Val(Text1.Text)
    H = Val(Text2.Text)
    If W <> 0 And H <> 0 Then
       ' Picture1.Line (0, 0)-Step(W, 0)
       ' Picture1.Line -Step(0, H)
       ' Picture1.Line -Step(-W, 0)
       ' Picture1.Line -Step(0, -H)
        Picture1.Line (0, 0)-(W, H), , B
    End If
End Sub

⌨️ 快捷键说明

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