Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If this. is the form, what is the object reference?
Message
De
30/12/2007 00:40:36
 
 
À
30/12/2007 00:17:44
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01278421
Message ID:
01278425
Vues:
12
Matt,

"this." refers to whatever class you're writing the code in. So, say you have a class, MyTextBox, sub-classed from a TextBox ...in that class, "this." would refer to MyTextBox.
public class MyTextBox : System.Windows.Forms.TextBox
{
    private string MyString;

    private void MyMethod
    {
        this.MyString = "xyz";
    }
}
~~Bonnie




>In VFP "this." refers to the object where the code is running and "thisform." refers to the form that contains the object.
>
>In .C# on NET, I have seen in the sample code I have been studying that "this." refers to the form, so what do you use to refer to the control itself when you are programming code within an object?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform