This documentation is archived and is not being maintained.

Event parameter was not upgraded

Visual Studio .NET 2003

Some event parameters that were supported in Visual Basic 6.0 are no longer supported in Visual Basic .NET.

  • The Cancel parameter of the Form_Unload event is no longer supported. The Unload event is upgraded to the Closed event; when this event raises, garbage collection has already been initiated and it is too late to cancel.
  • The UnloadMode parameter of the Form_QueryUnload event is no longer supported. The QueryUnload event is upgraded to the Closing event; this event has no mechanism for determining why it was called.

What to do next

  • Move any code that is dependent on the Cancel parameter into the Closing event.
  • If it is necessary to determine why the form is closing, you will need to create an overloaded version of the Closing event with custom code to determine the caller.

See Also

Form.Closed Event | Form.Closing Event