© Microsoft Corporation. All rights reserved.

  General changes Examples
Constant names updated vbObjectError became VB6.Constants.vbObjectError; vbNullChar became ControlChars.NullChar
Variable type declarations Integer became Short; Long became Integer; Variant became Object
Sub syntax Inserted parentheses around Sub parameter list
Error objects (Err and Error) Referenced Err.Number explicitly and called ErrorToString function in place of Error call
Explicit default property refs Converted txtSetting to txtSetting.Text
String functions Converted function names: Trim$ became Trim; Left$ became Left
Main form changes Examples
Form definitions Added class definitions for frmSettings, Sub Main, constructor and destructor, component declarations and initialization, and a Region definition name "Windows Form Designer generated code"
Control arrays Replaced control arrays with Compatibility.VB6.TextBoxArray, CheckBoxArray, and ButtonArray; access to controls uses arrays
Constant definitions Added variable type Short to numeric Constant declarations
Form properties Added VB6.TwipsToPixelsX/Y and VB6.PixelsToTwipsX/Y around references to forms' Top and Left properties
Event routines New parameters eventSender and eventArgs
New events Replaced Form_QueryUnload with Form_Closing
Class cSetting changes Examples
Enum references Fully qualified enum references (such as csModes.csModeRegistry)
Obsolete functions Replaced IsMissing on Variant with IsNothing on Object; Len() became System.Runtime.InteropServices.Marshal.SizeOf
New object model Replaced App.Path with System.Winforms.Application.StartUpPath & App.EXEName with VB6.GetExeName
Fixed-length strings In GetSettingStr method, sBuf declared as VB6.FixedLengthString
Property syntax SaveMode property syntax changes for Get/Set procedures
Table 1 Wizard Casts a Spell on Your Code. The wizard's modifications account for changes in VB syntax and features, but the code structure doesn't change. Here's what it did when I converted my SettingsTest project.