The property CommonDialog.CancelError is not currently supported by VBUC, nevertheless it is possible get a similar behavior or functionality by using .NET properties.
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
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
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
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
8834 N Capital of Texas Hwy, Ste 302
Austin, TX 78759
Call us: +1 (425) 609-8458
info@wearegap.com