エラー発生時にエラー内容とプロシージャー名をダイアログに表示
Private Sub a()
Try
‘コード
Catch ex As Exception
Dim ErrCaption As String = My.Application.Info.ProductName & “(” & Reflection.MethodBase.GetCurrentMethod.Name & “)”
MessageBox.Show(ex.Message, ErrCaption, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub

