<< Click to Display Table of Contents >> Visual Basic .NET |
Throughout this manual, methods and parameters are always declared in the form <Data Type> <Name>, e.g. boolean AutoDelete would be declared in VB as Dim AutoDelete as Boolean.
Data Types:
VpeCoord is Double
boolean is Boolean
integer is Integer
long is Integer
string is String
Color is Color
In addition there are defined many enumerations as data types for properties as well as for parameters of methods:
e.g. property PenStyle [integer] PenStyle
declares a property which has the enumeration type "PenStyle" and which is named "PenStyle".
Data types in square-brackets, like "[integer]" in the example above, are not of interest for .NET users. They describe the data type for the ActiveX and VCL controls.
Example on using the above property: Doc.PenStyle = PenStyle.Solid
i.e. the property named PenStyle is assigned the value Solid of a pre-defined enumeration, which has the type PenStyle.
Methods:
The keyword method declares a method, e.g. method void CloseProgressBar().
A method is either a Sub or a Function, depending on how the return type of the method is declared. The keyword immediately following the word method declares the method’s return type.
void is a Sub which does not return a value, e.g.
method void StorePos() is in Visual Basic: Sub StorePos()
all other declarations declare a function, e.g.
method boolean WriteDoc(string FileName) is in Visual Basic .NET
Function WriteDoc(FileName as String) as Boolean
Properties:
The keyword property describes a property. The line below the declaration of the property explains, how the property can be accessed (read-only, write-only or read / write together) and if it can be accessed during runtime only, or also during design time.
Example:
property boolean PageScrollerTracking
read / write; design- & runtime
means: the property is of type Boolean, its name is PageScrollerTracking and it can be accessed for read (you can read its value, e.g. n = PageScrollerTracking) and for write (you can assign it a value, e.g. PageScrollerTracking = True) and it is available during runtime (while your application is running) and design time (when you are developing your forms).
It would be declared in Visual Basic .NET as Dim PageScrollerTracking as Boolean