Event MyEvent(Param1 As Long, Param2 As String)
RaiseEvent MyEvent(123, "abc")
RaiseEvent MyEvent(123, "abc")
Brusco писал(а):Всё это уже написано А вот это нужно вызать из стандартного модуля:
- Код: Выделить всё
RaiseEvent MyEvent(123, "abc")
'В контроле
Public Event MyEvent()
Private Handle As Long
Public Sub EnableTimer(ByVal hWnd As Long, ByVal Interval As Long)
Handle = hWnd
SetTimer Handle, 0, Interval, AddressOf TimerProc
End Sub
Public Sub Timer()
RaiseEvent MyEvent
End Sub
Private Sub UserControl_Show()
Call ObjectID(UserControl.Extender)
End Sub
Private Sub UserControl_Terminate()
Set Obj = Nothing
KillTimer Handle, 0
End Sub
'В модуле
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Public Obj As Object
Public Function ObjectID(ByVal ID As Object)
Set Obj = ID
End Function
Public Sub TimerProc(ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Call Obj.Timer
End Sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0