使程序的標(biāo)題條閃爍
發(fā)表時間:2024-02-03 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]建立新的項目文件,添加模塊文件,并填寫如下代碼:Public Declare Function FlashWindow _Lib "user32" (ByVal hwnd As Long, _ByVal bInvert As Long) As Long在窗體中添加兩個按鈕和一個...
建立新的項目文件,添加模塊文件,并填寫如下代碼:
Public Declare Function FlashWindow _Lib "user32" (ByVal hwnd As Long, _ByVal bInvert As Long) As Long
在窗體中添加兩個按鈕和一個計時器,并用設(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運行程序。