Is it possible to add the “Thisform” keyword to the foxpro dialect of X#?
Posted: Sat Jan 18, 2025 2:35 am
Hi, Robert
I thought of this when I was using the foxpro dialect of X#.
“This” stands for the class/class instance itself and ‘Thisform’ stands for the form in VFP.
But in X# there is no such difference.
We can assume a scenario:
You have a custom class, and in the class method definition, you need to dynamically add a control to the form at runtime when an action is performed.
Then the class instance is added to the form at the moment of design. Because the object hierarchy of forms and class instances is full of variables, if you use “This.Parent.Parent......” this way, it is still a relatively complex piece of code assuming that this can be accomplished.
Everything would be simpler if the existence of “Thisform".
I thought of this when I was using the foxpro dialect of X#.
“This” stands for the class/class instance itself and ‘Thisform’ stands for the form in VFP.
But in X# there is no such difference.
We can assume a scenario:
You have a custom class, and in the class method definition, you need to dynamically add a control to the form at runtime when an action is performed.
Then the class instance is added to the form at the moment of design. Because the object hierarchy of forms and class instances is full of variables, if you use “This.Parent.Parent......” this way, it is still a relatively complex piece of code assuming that this can be accomplished.
Everything would be simpler if the existence of “Thisform".