B
Bill D
In a simple Windows forms application, the main form is
called Form1. Within this form's class, I refer to the
the running instance of this main class as "this" as in
this.Text = "NEW TEXT"
I want to do something like change this Text on the Form1
window from within another class. Trying
Form1.Text = "TEXT FROM CLASS"
or
Form1.ActiveForm.Text = "TEXT FROM CLASS"
lead to errors such as "object reference not set to an
instance of an object". This makes sence because Form1 is
the class name and not the instance name. However, what
is the instance name, the name of the instance that is
referred to as "this" within the main class?
Thanks for any input.
called Form1. Within this form's class, I refer to the
the running instance of this main class as "this" as in
this.Text = "NEW TEXT"
I want to do something like change this Text on the Form1
window from within another class. Trying
Form1.Text = "TEXT FROM CLASS"
or
Form1.ActiveForm.Text = "TEXT FROM CLASS"
lead to errors such as "object reference not set to an
instance of an object". This makes sence because Form1 is
the class name and not the instance name. However, what
is the instance name, the name of the instance that is
referred to as "this" within the main class?
Thanks for any input.