I've written a function that is intended to modify some of the properties of
whatever form is to it. The function, declared within frmTasks, looks like
this
public void FormActivated(Form sender){...}
and the call looks like this
frmTasks.FormActivated(this);
The error message is:
An object reference is required for the nonstatic field, method, or
property
I've tried including 'ref' in both the function definition and the call to
it, but that results in this:
Argument '1': cannot convert from 'ref FollowUpApp.frmCategories' to 'ref
System.Windows.Forms.Form'
Cannot pass '<this>' as a ref or out argument because it is read-only
So, how does one go about passing a form as an argument to a function that
resides outside the form's cs? BTW, I want to do this because I need to run
the same code on several forms within this application.
Thanks.