使程序的標(biāo)題條閃爍
發(fā)表時(shí)間:2024-06-08 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]建立新的項(xiàng)目文件,添加模塊文件,并填寫如下代碼:Public Declare Function FlashWindow _Lib "user32" (ByVal hwnd As Long, _ByVal bInvert As Long) As Long在窗體中添加兩個(gè)按鈕和一個(gè)...
建立新的項(xiàng)目文件,添加模塊文件,并填寫如下代碼:
Public Declare Function FlashWindow _Lib "user32" (ByVal hwnd As Long, _ByVal bInvert As Long) As Long
在窗體中添加兩個(gè)按鈕和一個(gè)計(jì)時(shí)器,并用設(shè)置以下屬性:
command1.caption="開始"
command2.caption="停止"
timer1.interval=500 ''每0.5秒閃爍一次
timer1.enabled=false
Private Sub Timer1_Timer()
a& = FlashWindow(Me.hwnd, 1)
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
按F5運(yùn)行程序。