VBUC
Visual Basic Upgrade Companion. VB6 Converter for .NET & Web.

VB6
ASP
RapidScan-LogoDownload Now

WebMAP
Cloud Application Migration Tools Transform Desktop Applications

C#
Silverlight
Access
VB.NET
PowerBuilder
Winforms
ASP.NET Web Forms

SnowConvert
The best available tools to perform code migrations from a source database or Spark application to Snowflake.

Oracle
Spark Scala
Spark Python
SQL Server
Teradata

Get Started
There are countless ways to take advantage of BlackDiamond Studio and SnowConvert.

Migration and Other Snowflake Services
Get Up and Running with Snowpark
Using the SnowConvert Trial
Build a Cross-Platform Object Inventory

Try BlackDiamond Studio

Time to Mobilize
Free Assessment Tool

VB to .NET

WARNING #6022

The CommonDialog CancelError property is not supported in Visual Basic .NET.

Description 

The property CommonDialog.CancelError is not currently supported by VBUC, nevertheless it is possible get a similar behavior or functionality by using .NET properties. 

Recommendations 

Understand how the CommonDialog.CancelError property is used in the VB6 source code and apply a manual change in order to emulate the behavior in the .NET platform. 

In .NET, the CommonDialog.ShowDialog() method shows the Dialog and after the dialog is closed, returns the information of the Dialog button that was pressed by the user. This returning value must be compared against the members of the System.Windows.Forms.DialogResult Enumeration 

Sample VB6 

Private Sub cmdColour_Click()
On Error GoTo errhandler
CommonDialog1.CancelError = True

' Display the Colour dialog box
CommonDialog1.ShowColor
' Set the forms background colour to the one selected
Me.BackColor = CommonDialog1.Color
Exit Sub
errhandler:
MsgBox "You canceled the dialog box"
End Sub

Target VB.NET 

Private Sub cmdColour_Click()
Try
'UPGRADE_ISSUE: (2064) MSComDlg.CommonDialog property CommonDialog1.CancelError was not upgraded.
CommonDialog1.setCancelError(True)

' Display the Colour dialog box
CommonDialog1Color.ShowDialog()
' Set the forms background colour to the one selected
Me.BackColor = CommonDialog1Color.Color
Catch
MessageBox.Show("You canceled the dialog box", My.Application.Info.Title)
End Try
End Sub

Target C# 

Private Sub cmdColour_Click()
Try
'UPGRADE_ISSUE: (2064) MSComDlg.CommonDialog property CommonDialog1.CancelError was not upgraded.
CommonDialog1.setCancelError(True)

' Display the Colour dialog box
CommonDialog1Color.ShowDialog()
' Set the forms background colour to the one selected
Me.BackColor = CommonDialog1Color.Color
Catch
MessageBox.Show("You canceled the dialog box", My.Application.Info.Title)
End Try
End Sub
Talk To An Engineer