form1.frm

来自「This assignment requires you to complete」· FRM 代码 · 共 55 行

FRM
55
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   7665
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10380
   LinkTopic       =   "Form1"
   ScaleHeight     =   7665
   ScaleWidth      =   10380
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   615
      Left            =   4560
      TabIndex        =   1
      Top             =   6600
      Width           =   975
   End
   Begin VB.PictureBox Picture1 
      Height          =   5535
      Left            =   960
      ScaleHeight     =   5475
      ScaleWidth      =   8355
      TabIndex        =   0
      Top             =   360
      Width           =   8415
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function FloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
  Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
    
  Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
    
  Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  Private Sub Command1_Click()
          Picture1.ScaleMode = 3
          Picture1.Line (50, 50)-(300, 100)
          Picture1.Line (300, 100)-(250, 300)
          Picture1.Line (250, 300)-(50, 200)
          Picture1.Line (50, 200)-(50, 50)
          Dim hBrush     As Long
          Dim hOldBrush     As Long
          hBrush = CreateSolidBrush(RGB(255, 0, 0))
          hOldBrush = SelectObject(Picture1.hdc, hBrush)
          FloodFill Picture1.hdc, 100, 100, RGB(0, 0, 0)
          SelectObject Picture1.hdc, hOldBrush
          DeleteObject hBrush
  End Sub

⌨️ 快捷键说明

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