📄 m52.htm
字号:
<html>
<head>
<title>VB教程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<p align="center"><script src="../../1.js"></script></a>
<body bgcolor="#ffffff" leftmargin="5" topmargin="1" marginheight="5" marginwidth="5">
<div align=center>
<table border=0 cellpadding=0 cellspacing=0 width=680 align="center">
<tbody>
<tr>
<td bgcolor=#000000 height=9>
<div align=center class=H1> 爆炸式显示表单</font> </font> </font></div>
</td>
</tr>
<tr valign=top>
<td class=H1 height=76>
<p align="left"> <br>
<font color="#000000" class="unnamed1"> 这是一个显示表单的特殊效果(由小变大)</font><br>
<br>
<br>
</font></p>
<table border=0 width="683">
<tbody>
<tr>
<td> <font color="#000000">Option Explicit<br>
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long)
As Long<br>
Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long,
_<br>
ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As
Long) As Long<br>
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As
Long, _<br>
ByVal hObject As Long) As Long<br>
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject
As Long) As Long<br>
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long,
ByVal hdc As Long) As Long<br>
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)<br>
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor
As Long) As Long<br>
Private Declare Function GetBkColor Lib "gdi32" (ByVal hdc As Long)
As Long<br>
<br>
Private hbrush As Long, hdc5 As Long<br>
<br>
Private Sub Form_Load()<br>
Dim dx As Long, dy As Long<br>
Dim rx1 As Long, rx2 As Long, ry1 As Long, ry2 As Long<br>
Dim i As Long, j As Long, bcolor As Long<br>
Dim DispCnt As Long<br>
<br>
DispCnt = 60 '一共Display多少次矩形後才显示Form<br>
hdc5 = GetDC(0)<br>
bcolor = GetBkColor(Me.hdc) '取得form的背景色<br>
'注:之所以不使用me.BackColor的原因是:这个属性不一定使用调色盘,<br>
' 如果使用系统配色,那结果会不对<br>
hbrush = CreateSolidBrush(bcolor) '设定笔刷颜色<br>
Call SelectObject(hdc5, hbrush)<br>
dx = Me.Width \ (DispCnt * 2)<br>
dy = Me.Height \ (DispCnt * 2)<br>
j = 1<br>
For i = DispCnt To 1 Step -1<br>
rx1 = (Me.Left + dx * (i - 1)) \ Screen.TwipsPerPixelX<br>
ry1 = (Me.Top + dy * (i - 1)) \ Screen.TwipsPerPixelY<br>
rx2 = rx1 + dx * 2 * j \ Screen.TwipsPerPixelX<br>
ry2 = rx1 + dy * 2 * j \ Screen.TwipsPerPixelY<br>
j = j + 1<br>
Call Rectangle(hdc5, rx1, ry1, rx2, ry2)<br>
Sleep (1)<br>
Next i<br>
Call ReleaseDC(0, hdc5)<br>
Call DeleteObject(hbrush)<br>
End Sub<br>
</font></span> <br>
</td>
</tr>
</tbody>
</table>
<p align="left"> <br>
</table>
</div>
<p align="center"><a href="../../pian/vb.htm">回首页</a>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -