Hi,
I am new to vb.net.I have three form.
The first one is MDIparent form (Mainform) which will created unlimited MDIchild form of (Mpfform).Mpfform contain Data Grid View.
Each Mpfform can create only one (Dmfform -non MDI).
Dmfform contain one "Start" button.
My problem is, how can i address the specific Mpfform created by Mainform or
Dmfform created from specific Mpfform?
Ive tried using my code below with no success. Please help me.
1) code in Mainform : to create Mpfform
Public mpf(50) As Mpfform()
Public num As Integer = 0
Private Sub NewMenuItem_File_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewMenuItem_File.Click
num += 1
mpf(num) = New Mpfform()
mpf(num).Text = "ModbusPoll:" & CStr(num)
mpf(num).Name = "ModbusPollFormFull" & num
mpf(num).dmf.Text = "Display Mode:" & CStr(num)
mpf(num).dmf.Name = "Display Mode:" & num
mpf(num).TopLevel = False
mpf(num).BringToFront()
mpf(num).Show()
End Sub
2) code in Mpfform - Showing Dmfform
Public dmf As New Dmfform
Private Sub DataDisplayModeMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataDisplayModeMenuItem.Click
dmf.Show()
End Sub
3)code in Dmfform - addressing problem
Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start.Click
If Mainform.mpf(Mainform.num).Datagridview.RowCount <> Nothing Then
Me.mytimer3.Interval = 1000
Me.mytimer3.Start()
Else
MsgBox("Definition of the modbus properties is currently not available." & vbNewLine & "Please define the properties in the Measurement window : Communication >> Modbus Properties")
End If
End Sub
How can i address the correct DGV of Mpfform to this code?
"Mainform.mpf(Mainform.num).Datagridview.RowCount" ?