日期:2008-12-16 浏览次数:20375 次
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1 '窗口置顶
Const SWP_SHOWWINDOW = &H40 ‘显示窗体
Const SWP_NOSIZE = &H1 '不允许改变大小
Private Sub Form_Load()
'设置窗体永远置顶
SetWindowPos Me.hwnd, HWND_TOPMOST, Me.Top, Me.Left, Me.Width, Me.Height, SWP_NOSIZE Or SWP_SHOWWINDOW
End Sub
'Time1 and Time2 配合达到延时效果
Private Sub Timer1_Timer()
Timer2.Enabled = True
MDIForm1.Show
End Sub
Private Sub Timer2_Timer()
Unload Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Unload Me
MDIForm1.Show
End Sub
Private Sub Image1_Click()
Unload Me
MDIForm1.Show
End Sub