新手求助!!!一个vb程序问题!!!!
我一个同学做了一个程序,运行的时候,封面在左上角,而且很小,几乎看不到,然后3秒后消失,请问各位高手怎么回事??如何解决???封面编码如下:
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
Private Sub Form_Load()
Dim fWidth As Integer
Dim i As Integer, t As Integer, l As Integer
Dim w As Integer, h As Integer
frmcover.BackColor = &HC0C0C0
frmcover.Left = (Screen.Width - Width) / 2
frmcover.Top = (Screen.Height - Height) / 2
frmcover.ScaleMode = 3: fWidth = 4
frmcover.AutoRedraw = True
For i = 1 To fWidth
t = i
l = i
h = ScaleHeight
w = ScaleWidth
Line (1, t)-(1, h - i), RGB(255, 255, 255)
Line (1, t)-(w - i, t), RGB(255, 255, 255)
Line (w - 1, t)-(w - 1, h - t), RGB(64, 64, 64)
Line (1, h - 1)-(w - 1, h - 1), RGB(64, 64, 64)
Next i
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H10
Const SWP_SHOWWINDOW = &H40
Const flags = SWP_NOMOVE Or SWP_SHOWWINDOW
Screen.MousePointer = 11
frmcover.Show
frmcover.Refresh
SetWindowPos frmcover.hwnd, HWND_TOPMOST, 10, 10, 10, 10, flags
End Sub
Private Sub Form_Activate()
Timer1.Interval = 3000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
frmmain.Timer1.Enabled = False
Unload frmcover
Screen.MousePointer = 0
End Sub