Thomas Risi Softwareentwicklung
Addins - Datenbanklösungen - Komponenten - RTDServer - WebServices
UserForm die blinkt
Eine UserForm die sich durch Blinken bemerkbar macht. Um das Beispiel nachzubauen, benötigen Sie die Timerklasse CTimer ...
Quellcode für die UserForm ...
Option Explicit
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FlashWindow Lib "user32" ( _
ByVal hWnd As Long, _
ByVal bInvert As Long) As Long
Dim WithEvents Timer1 As cTimer
Dim hWnd As Long
Private Sub Timer1_OnTime()
Call FlashWindow(hWnd, True)
End Sub
Private Function GetHandleUF(uf As MSForms.UserForm) As Long
GetHandleUF = IIf(Int(Val(Application.Version)) < 9, _
FindWindow("ThunderXFrame", uf.Caption), FindWindow("ThunderDFrame", uf.Caption))
End Function
Private Sub UserForm_Activate()
Timer1.Create 1000
End Sub
Private Sub UserForm_Initialize()
Me.Caption = " Unsere kleine Form"
hWnd = GetHandleUF(Me)
Set Timer1 = New cTimer
End Sub
Private Sub UserForm_Terminate()
Set Timer1 = Nothing
End Sub
© 2001 -
by Thomas Risi