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
/// Flags MSForms controls being accessed from outside the UserForm that contains them.
11
11
/// </summary>
12
12
/// <why>
13
-
/// MSForms exposes UserForm controls as public fields; accessing these fields outside the UserForm class breaks encapsulation and needlessly couples code with specific form controls.
14
-
/// Consider encapsulating the desired values into their own 'model' class, making event handlers in the form manipulate these 'model' properties, and then the calling code can query this encapsulated state instead of querying form controls.
13
+
/// MSForms exposes UserForm controls as public fields; accessing these fields outside the UserForm class breaks encapsulation and couples
14
+
/// the application logic with specific form controls rather than the data they hold.
15
+
/// For a more object-oriented approach and code that can be unit-tested, consider encapsulating the desired values into their own 'model' class,
16
+
/// making event handlers in the form manipulate these 'model' properties, then have the code that displayed the form query this encapsulated state as needed.
0 commit comments