I am still far away from mastering C#, but the child in me is pushing me to continue improving my programming day by day.
When I make a WinForms application I want to change and use lot of controls pragmatically.
What I do not understand is when I need to use the this.control
keyword and when I should use just control
.
Sample:
If I want to change the text of my label I can write
mylabel.text = "Text for label"
or
this.mylabel.tex = "Text for label"
Which of these is the right way? Is there a simple explanation when to use the this
keyword when using controls in WinForms (such as datagrid, text, tables, etc.)?