1.设有一个按钮。按下按钮,生成两个窗体,A窗体置前,再按一次按钮,B窗体置前(代码)Option ExplicitDim aIsTop As BooleanPrivate Sub Command1_Click() If aIsTop Then A.ZOrder 0 Else B.ZOrder 0 End If aIsTop = Not aIsTop End Sub2.生成渐显窗口的代码 你看一下下面的.也许有帮助. http://download.csdn.net/source/594818
2:生成渐显窗口的代码 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 ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As LongPublic Sub ExplodeForm(f As Form, Movement As Integer) Dim myRect As RECT Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy% Dim TheScreen As Long Dim Brush As Long
For i = 1 To Movement Cx = formWidth * (i / Movement) Cy = formHeight * (i / Movement) X = myRect.Left + (formWidth - Cx) / 2 Y = myRect.Top + (formHeight - Cy) / 2 Rectangle TheScreen, X, Y, X + Cx, Y + Cy Next i
X = ReleaseDC(0, TheScreen) DeleteObject (Brush)
End Sub
form的 form1.show form1.zorder(0)
http://topic.csdn.net/t/20011228/16/447652.html
是不是需要加Imports? 为什么我这里窗体后面没有这个函数呢?
1.解:Private Sub Command1_Click() Static isTop As Boolean If isTop Then Form1.ZOrder 0 Else Form2.ZOrder 0 End If isTop = Not isTop End Sub 2.生成渐显窗口的代码 你看一下下面的.也许有帮助. http://download.csdn.net/source/571037 使你的窗体能够有浅近浅出的过渡效果
If aIsTop Then
A.ZOrder 0
Else
B.ZOrder 0
End If
aIsTop = Not aIsTop
End Sub2.生成渐显窗口的代码 你看一下下面的.也许有帮助.
http://download.csdn.net/source/594818
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 ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As LongPublic Sub ExplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
GetWindowRect f.hwnd, myRect
formWidth = (myRect.Right - myRect.Left)
formHeight = myRect.Bottom - myRect.Top
TheScreen = GetDC(0)
Brush = CreateSolidBrush(f.BackColor)
For i = 1 To Movement
Cx = formWidth * (i / Movement)
Cy = formHeight * (i / Movement)
X = myRect.Left + (formWidth - Cx) / 2
Y = myRect.Top + (formHeight - Cy) / 2
Rectangle TheScreen, X, Y, X + Cx, Y + Cy
Next i
X = ReleaseDC(0, TheScreen)
DeleteObject (Brush)
End Sub
form1.show
form1.zorder(0)
http://topic.csdn.net/t/20011228/16/447652.html
为什么我这里窗体后面没有这个函数呢?
Static isTop As Boolean
If isTop Then
Form1.ZOrder 0
Else
Form2.ZOrder 0
End If
isTop = Not isTop
End Sub
2.生成渐显窗口的代码 你看一下下面的.也许有帮助.
http://download.csdn.net/source/571037
使你的窗体能够有浅近浅出的过渡效果