NET language. All you have to do is load a reference to Microsoft. VisualBasic and add:. Notice that you can't use anything like the My object but it isn't difficult to create a wrapper that allows the classes to be used without instantiation.
The keyword Me refers to the current instance of an object. The Me reference is a hidden reference to every non-shared method of a class; shared methods are discussed later in this chapter. Each method can refer to the other methods and variables of that object by way of the Me reference. The Me reference is typically used in any of three ways. The first way is to qualify instance members that have the same name as parameters, as in the following:.
In this example, SomeMethod takes a parameter Hour with the same name as a member variable of the class. You can call this procedure and pass the current instance of the Form class as an argument by using the following statement. The My feature provides easy and intuitive access to a number of. NET Framework classes, enabling the Visual Basic user to interact with the computer, application, settings, resources, and so on. The MyBase keyword behaves like an object variable referring to the base class of the current instance of a class.
MyBase is commonly used to access base class members that are overridden or shadowed in a derived class. New is used to explicitly call a base class constructor from a derived class constructor. The MyClass keyword behaves like an object variable referring to the current instance of a class as originally implemented.
MyClass is similar to Me , but all method calls on it are treated as if the method were NotOverridable.
0コメント