金山词霸在显示时,会有个从中心扩散到正常窗体的特效,
扩散时,窗体大小没有变化,只是显示部分是从中心到窗体大小。
我也想实现类似的效果!
扩散时,窗体大小没有变化,只是显示部分是从中心到窗体大小。
我也想实现类似的效果!
解决方案 »
- 如何判断WindowsMediaPlayer已经开始播放?
- 如何把TreeView控件的节点node横连线变短一些,连线太长了不好看也占地方,是不是要调API改变
- 高分求救~~vb中并口控件的名称请大虾们给提供几个,我不太懂vb,急用!!
- 各位大侠,看看这个数据库该如何建立才好呢?小弟在线等待......
- 如何在vb窗体中划立体的线?就像frame的边框那种
- 如果服务器和客户端不在同一网段,连得上数据库吗?
- win2000下如何控制打印机纸张大小?
- 100分相送,如何调用IE删除IE历史记录?
- 窗体显示坐标
- 我有个程序原来用的很好 突然里面不能保存了 肯能是环境问题 求助大神 谢谢
- 请教怎样用vb在屏幕上输出内容呀?谢谢!
- Static x As Integer中x的值会改变吗?
Dim i As Integer
Dim j As Integer
Private Sub Form_Load()
Timer1.Interval = 1
End SubPrivate Sub Timer1_Timer()
If i < 5000 Then
i = i + 50
j = j + 50
Form1.Height = i
Form1.Width = j
End If
End Sub
Const IDANI_OPEN = &H1
Const IDANI_CLOSE = &H2
Const IDANI_CAPTION = &H3
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function SetRect Lib "User32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DrawAnimatedRects Lib "User32" (ByVal hWnd As Long, ByVal idAni As Long, lprcFrom As RECT, lprcTo As RECT) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim rSource As RECT, rDest As RECT, ScreenWidth As Long, ScreenHeight As Long
'retrieve the screen width and height
ScreenWidth = Screen.Width / Screen.TwipsPerPixelX
ScreenHeight = Screen.Height / Screen.TwipsPerPixelY
'set the source and destination rects
SetRect rSource, ScreenWidth, ScreenHeight, ScreenWidth, ScreenHeight
SetRect rDest, 0, 0, 200, 200
'animate
DrawAnimatedRects Me.hWnd, IDANI_CLOSE Or IDANI_CAPTION, rSource, rDest
'set the form's position
Me.Move 0, 0, 200 * Screen.TwipsPerPixelX, 200 * Screen.TwipsPerPixelY
End Sub
Dim i As Integer
Dim j As IntegerPrivate Sub Command1_Click()
Unload Me
End SubPrivate Sub Form_Load()
Timer1.Interval = 1
i = 405
j = 1680
End SubPrivate Sub Timer1_Timer()
If i < 5000 Then
i = i + 50
j = j + 50
Form1.Height = i
Form1.Width = j
Form1.Move Screen.Height / 2 - Form1.Height / 2, Screen.Width / 2 - Form1.Width / 2
End If
End Sub
'以下在模块中:
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Sub DeShrinkForm(ByRef frm As Form)
Dim lngWin As Long
Dim oldMode As Integer
Dim wW As Integer, hH As Integer, hToW As Single
Dim hfW As Integer
Dim hfH As Integer
Dim i As Integer
frm.ScaleMode = vbPixels
wW = frm.ScaleWidth
hH = frm.ScaleHeight
hfW = wW \ 2
hfH = hH \ 2
hToW = hH / wW
lngWin = CreateRectRgn(hfW - 1, hfW - 1, hfW + 1, hfW + 1)
SetWindowRgn frm.hwnd, lngWin, True
DeleteObject lngWin
frm.Visible = True
For i = hfW To -20 Step -1
lngWin = CreateRectRgn(i, i * hToW, wW - i, hH - i * hToW)
SetWindowRgn frm.hwnd, lngWin, True
DeleteObject lngWin
DoEvents
Next
lngWin = CreateRectRgn(0, 0, Screen.Width, Screen.Height)
SetWindowRgn frm.hwnd, lngWin, True
DeleteObject lngWin
frm.ScaleMode = oldMode
End Sub
'以下窗体中
Private Sub Form_Initialize()
DeShrinkForm Me
End Sub
'对函数DeShrinkForm 进一步修改,可以实现非常丰富的效果。