弹出窗口时出现动画效果VB源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
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