Aフォーム:
Public Class AForm
Private dt As DataTable
Private drow As DataRow
Private Sub AForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
dt = New DataTable
dt.Columns.Add("RETUA", GetType(String))
dt.Columns.Add("RETUB", GetType(String))
dt.Columns.Add("RETUC", GetType(String))
drow = dt.NewRow
drow("RETUA") = "0"
drow("RETUB") = "1"
drow("RETUC") = "2"
Dim f As New BForm
f.drow = Me.drow
f.Show(Me)
End Sub
End Class
Bフォーム:
Public Class BForm
Private _drow As DataRow
Public Property drow() As DataRow
Get
Return _drow
End Get
Set(ByVal value As DataRow)
_drow = value
End Set
End Property
Private Sub BForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim brow As DataRow = _drow
MessageBox.Show(brow(2).ToString)
End Sub
End Class
|