Public Class frmViewEditBoundary
Inherits System.Windows.Forms.Form
'some code omitted for clarity
'constructor
Public Sub New(ByVal data As Boundary)
MyBase.New()
InitializeComponent()
itsBoundary = data
End Sub
Public Shadows Function ShowDialog(ByRef owner As IWin32Window) As Boundary
MyBase.ShowDialog(owner) 'call the base class version and ignore its return value
Return DialogResult 'return our own data
End Function
Public Shadows Property DialogResult() As Boundary
Get
Return itsDialogResult
End Get
Set(ByVal Value As Boundary)
itsDialogResult = Value
End Set
End Property
'other code omitted for clarity
Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
DialogResult = Nothing
Me.Close()
End Sub
Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
DialogResult = itsBoundary
Me.Close()
End Sub
End Class