ecommerce web developer development freelance website designer India
Initialize

· The Initialize event occurs when an application creates an instance of a Form, MDIForm, or class.
· The Initialize event is typically used to prepare an application for use. Examples of such are assigning initial
values to variables, to move controls and/or to resize controls to accommodate initialization data.
· The Initialize event will fire only once during the life of the application. To fire the Initialize event again, you must
exit and restart the application. So a form that's unloaded, and then redisplayed will not trigger the Initialize
event a second time, or at all.

Load

· The Load Event is used to perform actions that need to occur prior to the form being displayed. It is also used to
assign default values to the form and its controls.
· Remember that the Load event is fired after the Initialize event, and a form loaded using the Load statement isn't
visible unless you use the Show method, or set the form's Visible property to True.
· A forms Load event can fire multiple times during an application's life. This happens when a form start as the
result of the Load statement, Show statement, or when a reverence is made to an unloaded form's properties,
methods, or controls.

Activate

· The Activate event fires when the form receives focus from another form within the same project and this event
fires only when the form is visible.
· Remember also that the GotFocus event fires after the Activate event.
· The Activate event fires only when focus is changing within the same application, not if you set the focus to a
different application and then return to Visual Basic program.

Deactivate

· The Deactivate event fires when the form loses focus to another form.
· This event then fires after the LostFocus event.
· The Deactivate event fires only when changing within the same application, not if you set the focus to a
different application.
QueryUnload

· The QueryUnload event is very useful when you need to know how the user is closing the form.
· The UnloadMode argument of the QueryUnload event informs you how the form was closed and allows the
cancellation of the event.
· Some actions may cause the QueryUnload event to fire. Actions like the user chooses the Close command from
the Control menu, invoke the Unload statement from code, current Microsoft Windows operating environment
session is ending, Microsoft Windows Task Manager is closing the application or an MDI child form is closing
because the MDI form is closing.
· To stop a form from unloading, set the Cancel argument of the QueryUnload event to True.

Unload

· The Unload event occurs before the Terminate event.
· Use the Unload event procedure to verify that the form should be unloaded or to specify actions that take place
when unloading the form.
· An example of such an action will be to include form-level validation code needed to close the form or to save
data to a file.
· All forms will be unloaded from the application if the End statement is added to this event.
· Important, setting Cancel to any nonzero value prevents the form from being removed, but doesn't stop other
events, such as exiting from Microsoft Windows operating environment. Alternatively use the QueryUnload event
to stop Windows from shutting down.

Terminate

· The Terminate event occurs when all references to an instance of a Form, MDIForm, or class are removed from
memory.
· If a Class is remove because the application terminated abnormally the Terminate event will not fire.
· For Classes the Terminate event will occur before the Unload event.
Form Events

1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200

Express News India | Freelance ecommerce web development India