get value of parent form when form is opened using ShowDialog
MDI -> FORM1 -> FORM2 using (Showdialog)
I have tried this...
This is a usercontrol placed on FORM1
Dim frmnm As String = System.Reflection.Assembly.GetEntryAssembly.GetName.Name & "." & AddbtnForm
Dim arg As Object() = {Me.CurrentValue}
Dim frm As Form = DirectCast(System.Reflection.Assembly.GetEntryAssembly.CreateInstance(frmnm, True, Reflection.BindingFlags.CreateInstance, Nothing, arg, Nothing, Nothing), Form)
Dim d As New DialogResult
frm.Tag = Me.ParentValue
d = frm.ShowDialog(Me.ParentForm)
If d = DialogResult.Cancel Then
Refresh()
End If
in Form2...
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim f = DirectCast(Me.Owner, FORM1)
Me.Id = f.Id
End Sub
Please help...
Thanks in adv.