Public Class frmDialog
Property ReturnID As String
Private Sub OK_Button_Click(sender As Object, e As EventArgs) Handles OK_Button.Click
ReturnID = DataGridViewX1.SelectedRows(0).Cells(0).Value.ToString()
Me.DialogResult = True
End Sub
End Class
'主窗体
Public Class frmTest
Private Sub SelectIndex()
盯碧 Dim dlg 滚则或As New frmDialog
If dlg.ShowDialog = DialogResult.OK Then
MessageBox.Show(dlg.ReturnID)
End 大伍If
End Sub
End Class