Property or statement is not supported
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Property or statement is not supported

Visual Studio .NET 2003

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.
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)

See Also

Calendar Class | Programming Element Support Changes Summary

© 2016 Microsoft