BYTEINSIGHT
GAPVelocity AI Studio helps you move from outdated tech stacks to the latest desktop, web, and cloud platforms—smarter, faster, and with less risk.
Choose a platform to see migration options:
Our comprehensive approach to application modernization, from assessment to production deployment.
Transformation Services
Not Sure Where to Start?
During the upgrade process, some events can be mapped to .NET with minor behavior differences. If this EWI is displayed in a given project, the selected target event will not threaten the functional equivalence of the resulting code but can create small differences that may require some manual fine tuning.
Each case will have to be evaluated individually, as the behavior differences may not be significant for every project. Some common properties with new behaviors include the following:
Public Sub ShowPicture(ByVal myForm As Form) MsgBox(myForm.Picture.Height) End Sub
Public Sub ShowPicture(ByRef myForm As Form1) 'UPGRADE_WARNING: (2065) Form property myForm.Picture has a new behavior. MessageBox.Show(CStr(myForm.BackgroundImage.Height), Application.ProductName) End Sub
In some cases the migrated Property or method will behave in a manner that is inconsistent with the desired functionality.
In this case, the Picture property for example will behave different than .Net's BackgroundImage when the image assigned is smaller than the form. In Visual Basic 6 the image would be displayed in the top left corner, while in .Net it's tiled across the form.
In this particular example we're merely accessing the Height property, so we might be tempted to strip out the EWI comment and leave it at that. However, the Height property in Visual Basic 6 returns a value in HiMetric units, where as in .Net it's in pixels! So we can't leave the code as is and maintain functional equivalence.Assuming, the application still requires HiMetric units be returned, we'll need to convert the value to HiMetric units.
For the sake of brevity we'll just assume that a PixelsToHiMetric method has already been coded for just this purpose.
Public Sub ShowPicture(ByRef myForm As Form1) 'Convert Pixels to HiMetric MessageBox.Show(CStr(PixelsToHiMetric(myForm.BackgroundImage.Height)), Application.ProductName) End Sub
static public void ShowPicture(Form1 myForm) { //UPGRADE_WARNING: (2065) Form property myForm.Picture has a new behavior. MessageBox.Show(myForm.BackgroundImage.Height.ToString(), Application.ProductName); }
In some cases the migrated Property or method will behave in a manner that is inconsistent with the desired functionality.
In this case, the Picture property for example will behave different than .Net's BackgroundImage when the image assigned is smaller than the form. In Visual Basic 6 the image would be displayed in the top left corner, while in .Net it's tiled across the form.
In this particular example we're merely accessing the Height property, so we might be tempted to strip out the EWI comment and leave it at that. However, the Height property in Visual Basic 6 returns a value in HiMetric units, while the property in .Net returns it in pixels. So we can't leave the code as is and maintain functional equivalence. Assuming, the application still requires HiMetric units be returned, we'll need to convert the value to HiMetric units.
For the sake of brevity we'll just assume that a PixelsToHiMetric method has already been coded for just this purpose.
static public void ShowPicture(Form1 myForm) { //UPGRADE_WARNING: (2065) Form property myForm.Picture has a new behavior. MessageBox.Show(PixelsToHiMetric(myForm.BackgroundImage.Height).ToString(), Application.ProductName); }