You cannot pass things by reference with setters. It must be ByVal
. From the VB.NET Specification:
§9.7.2 If a parameter list is specified, it must have one member, that member must have no modifiers except ByVal, and its type must be the same as the type of the property.
I don't think it particularly makes sense to use ByRef in a property setter. Using ByRef implies that you may want to change the reference of what invokes the setter.
Form
is a reference type (class), so you want to pass it by value. Otherwise you are passing a reference of a reference type.