You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 14, 2024. It is now read-only.
`Text1.Refresh` and `Text2.Refresh` don't compile since the member `Refresh` doesn't exist on `TextBox`. They cause compilation errors otherwise.
`Form_Load` should be `UserForm_Initialize`.
`dblSecond` is declared, but never used.
Indented according to default VBA settings.
`vbNullString` used in favor of `""`.
`ExampleEvent` added an sub was previously nameless.
The required _eventname_ is the name of an event declared within the[module](vbe-glossary.md) and follows Basic variable naming conventions.
20
+
The required _eventname_ is the name of an event declared within the[module](vbe-glossary.md) and follows Basic variable naming conventions.
21
21
The **RaiseEvent** statement syntax has these parts:
22
22
23
23
24
24
|**Part**|**Description**|
25
25
|:-----|:-----|
26
26
|_eventname_|Required. Name of the event to fire.|
27
-
|_argumentlist_|Optional. Comma-delimited list of [variables](vbe-glossary.md), [arrays](vbe-glossary.md), or [expressions](vbe-glossary.md) The _argumentlist_ must be enclosed by parentheses. If there are no[arguments](vbe-glossary.md), the parentheses must be omitted.|
27
+
|_argumentlist_|Optional. Comma-delimited list of [variables](vbe-glossary.md), [arrays](vbe-glossary.md), or [expressions](vbe-glossary.md) The _argumentlist_ must be enclosed by parentheses. If there are no[arguments](vbe-glossary.md), the parentheses must be omitted.|
28
28
**Remarks**
29
29
If the event has not been declared within the module in which it is raised, an error occurs. The following fragment illustrates an event declaration and a procedure in which the event is raised.
30
30
@@ -34,13 +34,13 @@ If the event has not been declared within the module in which it is raised, an e
34
34
' Declare an event at module level of a class module
35
35
EventLogonCompleted(UserNameasString)
36
36
37
-
Sub
37
+
SubExampleEvent()
38
38
' Raise the event.
39
39
RaiseEventLogonCompleted("AntoineJan")
40
40
EndSub
41
41
```
42
42
43
-
If the event has no arguments, including empty parentheses, in the **RaiseEvent**, invocation of the event causes an error. You can't use **RaiseEvent** to fire events that are not explicitly declared in the module. For example, if a form has a Click event, you can't fire its Click event using **RaiseEvent**. If you declare a Click event in the[form module](vbe-glossary.md), it shadows the form's own Click event. You can still invoke the form's Click event using normal syntax for calling the event, but not using the **RaiseEvent** statement.
43
+
If the event has no arguments, including empty parentheses, in the **RaiseEvent**, invocation of the event causes an error. You can't use **RaiseEvent** to fire events that are not explicitly declared in the module. For example, if a form has a Click event, you can't fire its Click event using **RaiseEvent**. If you declare a Click event in the[form module](vbe-glossary.md), it shadows the form's own Click event. You can still invoke the form's Click event using normal syntax for calling the event, but not using the **RaiseEvent** statement.
44
44
Event firing is done in the order that the connections are established. Since events can have **ByRef** parameters, a process that connects late may receive parameters that have been changed by an earlier event handler.
45
45
46
46
## Example
@@ -61,30 +61,30 @@ Option Explicit
61
61
62
62
PrivateWithEventsmTextAsTimerState
63
63
64
-
PrivateSubCommand1_Click()
65
-
Text1.Text="From Now"
66
-
Text1.Refresh
67
-
Text2.Text="0"
68
-
Text2.Refresh
69
-
CallmText.TimerTask(9.84)
70
-
EndSub
64
+
PrivateSubCommand1_Click()
65
+
Text1.Text="From Now"
66
+
Text2.Text="0"
67
+
68
+
mText.TimerTask9.58
69
+
EndSub
71
70
72
-
PrivateSubForm_Load()
73
-
Command1.Caption="Click to Start Timer"
74
-
Text1.Text=""
75
-
Text2.Text=""
76
-
Label1.Caption="The fastest 100 meters ever run took this long:"
77
-
SetmText=NewTimerState
78
-
EndSub
71
+
PrivateSubUserForm_Initialize()
72
+
Command1.Caption="Click to start Timer"
73
+
Text1.Text=vbNullString
74
+
Text2.Text=vbNullString
75
+
Label1.Caption="The fastest 100 meters ever run took this long:"
0 commit comments