simple question
-
"this" is a key word to refer to the currently instantiated class that the method is in so if you had:
public ref class FrmMyCoolForm : public System::Windows::Forms::Form { public: FrmMyCoolForm(void) { this->Visible = false; } }
You would be changing the visiblility of the object that the method was called from. (Probably not close to a textbook definition but hope it makes sense) EDIT: Here is a definition C++ keyword used in a member function to point at the object currently being operated on. -
"this" is a key word to refer to the currently instantiated class that the method is in so if you had:
public ref class FrmMyCoolForm : public System::Windows::Forms::Form { public: FrmMyCoolForm(void) { this->Visible = false; } }
You would be changing the visiblility of the object that the method was called from. (Probably not close to a textbook definition but hope it makes sense) EDIT: Here is a definition C++ keyword used in a member function to point at the object currently being operated on. -
THanks- I inderstad that. I'm referring to the CreateGraphics. CreateGraphics is a "method" when a WHAT is instantiate. int x; this->Foo() == x.Foo() //OK this.CreateGraphics() // What's "this"? in THIS case Is it Graphics g?