用什么VB控件可以产生折叠页(folder)的效果?该怎么处理
用什么VB控件可以产生折叠页(folder)的效果????
就是点击控件,窗体出现相应的界面
------解决方案--------------------
打開或關閉窗口的13種特效
'Private Sub Command1_Click()
' Call Form_Unload(True)
'End Sub
Private Sub Form_Activate()
AnimateForm Me.Hwnd, aload, eAppearFromLeft, 10
End Sub
Private Sub Form_Unload(Cancel As Integer)
AnimateForm Me.Hwnd, uload, eAppearFromLeft, 10
End Sub
'[APIs聲明]
Private Declare Function CreateRectRgn Lib "gdi32.dll " (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32 " (ByVal hObject As Long) As Long
Private Declare Function SetWindowRgn Lib "user32 " (ByVal Hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Declare Function CombineRgn Lib "gdi32.dll " (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll " (ByVal dwMilliseconds As Long)
Private Declare Function GetWindowRect Lib "user32.dll " (ByVal Hwnd As Long, ByRef lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'[事件]
Public Enum AnimeEventEnum
aUnload = 0
Aload = 1
End Enum
'[特效]
Public Enum AnimeEffectEnum
eAppearFromLeft = 0
eAppearFromRight = 1
eAppearFromTop = 2
eAppearFromBottom = 3
eGenerateLeftTop = 4
eGenerateLeftBottom = 5
eGenerateRightTop = 6
eGenerateRightBottom = 7
eStrechHorizontally = 8
eStrechVertically = 9
eZoomOut = 10
eFoldOut = 11
eCurtonHorizontal = 12
eCurtonVertical = 13
End Enum
'[常數]
Private Const RGN_AND As Long = 1
Private Const RGN_OR As Long = 2
Private Const RGN_XOR As Long = 3
Private Const RGN_COPY As Long = 5
Private Const RGN_DIFF As Long = 4
Public Function AnimateForm(Hwnd As Long, ByVal aEvent As AnimeEventEnum, _
Optional ByVal aEffect As AnimeEffectEnum = 11, _
Optional ByVal FrameTime As Long = 10, _
Optional ByVal FrameCount As Long = 33) As Boolean
On Error GoTo Handle
Dim Rct As RECT
Dim X1 As Long
Dim Y1 As Long
Dim hRgn As Long
Dim tmpRgn As Long
Dim XValue As Long
Dim YValue As Long
Dim XIncr As Double
Dim YIncr As Double
Dim wHeight As Long
Dim wWidth As Long
GetWindowRect Hwnd, Rct
wWidth = Rct.Right - Rct.Left
wHeight = Rct.Bottom - Rct.Top
Select Case aEffect
Case eAppearFromLeft
XIncr = wWidth / FrameCount
For X1 = 0 To FrameCount
'定義當前幀大小/建立
XValue = X1 * XIncr
hRgn = CreateRectRgn(0, 0, XValue, wHeight)
If aEvent = aUnload Then
tmpRgn = CreateRectRgn(0, 0, wWidth, wHeight)
CombineRgn hRgn, hRgn, tmpRgn, RGN_XOR
DeleteObject tmpRgn
End If
'新的層
SetWindowRgn Hwnd, hRgn, True: DoEvents
Sleep FrameTime
Next X1
Case eAppearFromRight
------解决方案--------------------
XIncr = wWidth / FrameCount
For X1 = 0 To FrameCount
就是点击控件,窗体出现相应的界面
------解决方案--------------------
打開或關閉窗口的13種特效
'Private Sub Command1_Click()
' Call Form_Unload(True)
'End Sub
Private Sub Form_Activate()
AnimateForm Me.Hwnd, aload, eAppearFromLeft, 10
End Sub
Private Sub Form_Unload(Cancel As Integer)
AnimateForm Me.Hwnd, uload, eAppearFromLeft, 10
End Sub
'[APIs聲明]
Private Declare Function CreateRectRgn Lib "gdi32.dll " (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function DeleteObject Lib "gdi32 " (ByVal hObject As Long) As Long
Private Declare Function SetWindowRgn Lib "user32 " (ByVal Hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Declare Function CombineRgn Lib "gdi32.dll " (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll " (ByVal dwMilliseconds As Long)
Private Declare Function GetWindowRect Lib "user32.dll " (ByVal Hwnd As Long, ByRef lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'[事件]
Public Enum AnimeEventEnum
aUnload = 0
Aload = 1
End Enum
'[特效]
Public Enum AnimeEffectEnum
eAppearFromLeft = 0
eAppearFromRight = 1
eAppearFromTop = 2
eAppearFromBottom = 3
eGenerateLeftTop = 4
eGenerateLeftBottom = 5
eGenerateRightTop = 6
eGenerateRightBottom = 7
eStrechHorizontally = 8
eStrechVertically = 9
eZoomOut = 10
eFoldOut = 11
eCurtonHorizontal = 12
eCurtonVertical = 13
End Enum
'[常數]
Private Const RGN_AND As Long = 1
Private Const RGN_OR As Long = 2
Private Const RGN_XOR As Long = 3
Private Const RGN_COPY As Long = 5
Private Const RGN_DIFF As Long = 4
Public Function AnimateForm(Hwnd As Long, ByVal aEvent As AnimeEventEnum, _
Optional ByVal aEffect As AnimeEffectEnum = 11, _
Optional ByVal FrameTime As Long = 10, _
Optional ByVal FrameCount As Long = 33) As Boolean
On Error GoTo Handle
Dim Rct As RECT
Dim X1 As Long
Dim Y1 As Long
Dim hRgn As Long
Dim tmpRgn As Long
Dim XValue As Long
Dim YValue As Long
Dim XIncr As Double
Dim YIncr As Double
Dim wHeight As Long
Dim wWidth As Long
GetWindowRect Hwnd, Rct
wWidth = Rct.Right - Rct.Left
wHeight = Rct.Bottom - Rct.Top
Select Case aEffect
Case eAppearFromLeft
XIncr = wWidth / FrameCount
For X1 = 0 To FrameCount
'定義當前幀大小/建立
XValue = X1 * XIncr
hRgn = CreateRectRgn(0, 0, XValue, wHeight)
If aEvent = aUnload Then
tmpRgn = CreateRectRgn(0, 0, wWidth, wHeight)
CombineRgn hRgn, hRgn, tmpRgn, RGN_XOR
DeleteObject tmpRgn
End If
'新的層
SetWindowRgn Hwnd, hRgn, True: DoEvents
Sleep FrameTime
Next X1
Case eAppearFromRight
------解决方案--------------------
XIncr = wWidth / FrameCount
For X1 = 0 To FrameCount