frmanim.frm

来自「这是一本关于vb的实用编程」· FRM 代码 · 共 71 行

FRM
71
字号
VERSION 5.00
Begin VB.Form frmAnim 
   Caption         =   "Form2"
   ClientHeight    =   2580
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4470
   LinkTopic       =   "Form2"
   ScaleHeight     =   2580
   ScaleWidth      =   4470
   StartUpPosition =   2  '屏幕中心
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command1 
      Caption         =   "关闭"
      Height          =   495
      Left            =   1440
      TabIndex        =   0
      Top             =   960
      Width           =   1335
   End
End
Attribute VB_Name = "frmAnim"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Declare Function CreateSolidBrush Lib "gdi32" _
    (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" _
    (ByVal hObject As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hDC As Long, _
    lpRect As RECT, ByVal hBrush As Long) As Long
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type


Friend Sub PrintClient(ByVal hDC As Long, ByVal lParam As Long)

    Dim rct As RECT
    Dim hBr As Long

    'Fill in the hDC with the form's
    'background color. Otherwise the form
    'may appear strangely.
    rct.Left = 0
    rct.Top = 0
    rct.Right = ScaleX(ScaleWidth, ScaleMode, vbPixels)
    rct.Bottom = ScaleY(ScaleHeight, ScaleMode, vbPixels)
    hBr = CreateSolidBrush(TranslateColor(Me.BackColor))
    FillRect hDC, rct, hBr
    DeleteObject hBr

End Sub

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Form_Load()
    SubclassAnim Me
End Sub



⌨️ 快捷键说明

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