Originally posted by .NETGuard
Show us the error in the ErrorList box please.
By the way, "this." is not meant to be hard-coded in front of fields, so either your coding habits are bad OR you maye have decompiled a program and just copy & pasted its source.
Still, you have to show us the error from the ErrorList box
Originally posted by 1UP
Um no, that's generally how most of the world references objects. In this case "this" being the form. It's not really needed but in most examples you find on the internet you will see that.
If you were to reference another form's object it would be form_whatever.textbox_whatever.
I don't want to sound snarky but this is not meant for object referencing at anytime, there are very few case / scenario when you *MUST* use 'this'.
• The '
this' syntax is meant to be use when you need to invoke an explicit interface implementation from within the implementing class
• The '
this' syntax is meant to be use for declaring indexers (
You must login or register to view this content.)
• The '
this' syntax is meant to be use when you need to declare extension methods (
You must login or register to view this content.)
• The '
this' syntax is meant to be use for constructor chaining (
You must login or register to view this content.)
Every other case is either irrelevant or almost depreciated (have a look at
You must login or register to view this content. for instance !
). Again, I don't want to sound snarky, I only want your code not to looks like decompiled code.