aboutcall.bas

来自「星级酒店客房管理系统一套很不错的系统」· BAS 代码 · 共 38 行

BAS
38
字号
Attribute VB_Name = "aboutCall"
Option Explicit
Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Sub Explode(Newform As Form, Increment As Integer)
Dim Size As RECT                                                                                                ' setup form as rect type
GetWindowRect Newform.hwnd, Size
Dim FormWidth, FormHeight As Integer                                                                 ' establish dimension variables
FormWidth = (Size.Right - Size.Left)
FormHeight = (Size.Bottom - Size.Top)

Dim TempDC
TempDC = GetDC(ByVal 0&)                                                                                 ' obtain memory dc for resizing

Dim Count, LeftPoint, TopPoint, nWidth, nHeight As Integer                                      ' establish resizing variables
For Count = 1 To Increment                                                                               ' loop to new sizes
    nWidth = FormWidth * (Count / Increment)
    nHeight = FormHeight * (Count / Increment)
    LeftPoint = Size.Left + (FormWidth - nWidth) / 2
    TopPoint = Size.Top + (FormHeight - nHeight) / 2
    Rectangle TempDC, LeftPoint, TopPoint, LeftPoint + nWidth, TopPoint + nHeight     ' draw rectangles to build form
Next Count

DeleteDC (TempDC)                                                                                           ' release  memory resource

End Sub


⌨️ 快捷键说明

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