Property or statement is not supported
In Visual Basic 6.0, the Calendar property was a stand-alone property that determined the calendar (Gregorian or Hijri) to be used for date-related functions. In Visual Basic .NET, this property is no longer supported; the Calendar class in the System.Globalization namespace that supports several additional calendar types replaces it.
In Visual Basic 6.0, the Load statement could be used to load a form without displaying it. A form could also be loaded without displaying it by referencing any of its properties.
The Load statement is no longer supported in Visual Basic .NET. When an instance of a form is created using the New keyword, it is loaded but not displayed until the Show method is called.
The following code shows the usage of the Load statement:
' Visual Basic 6.0 Load Form2 Form2.Caption = "Hello" MsgBox Form2.Caption ' After upgrade to Visual Basic .NET 'UPGRADE_ISSUE: Load statement is not supported. Load(Form2) Form2.DefInstance.Text = "Hello" MsgBox (Form2.DefInstance.Text)
What to do next
- Remove the line of code that sets the Calendar property and add a reference to one of the following classes:
' If the Calendar property was 0 or vbCalGreg. Public Class GregorianCalendar Inherits Calendar ' If the Calendar property was 1 or vbCalHijri. Public Class Hijri Calendar Inherits Calendar
- Remove the line of code that contains the Load statement.
- If you need to load the form without showing it, use the New keyword, as in the following example:
' Modified code Dim Form2 As New Form2 Form2.Text = "Hello" MsgBox (Form2.Text)