Parent/Child Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sc5502
    New Member
    • Jun 2014
    • 102

    Parent/Child Forms

    I have a Parent Form (form1) that starts a child form (form2). Can the child form (form2) execute a routine that is already defined in the parent form (form1)? In my case the routine is one that displays a data grid view. If it can be done, how?

    Thanks in advance.
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    Declare the subroutine you want to share as Public

    Code:
    Form1
    
    Public Sub CALLMSGBOX()
    MsgBox("Form1:CALLMSGBOX")
    End Sub
    
    Form2
    :
    My.Forms.Form1.CALLMSGBOX()
    :
    Last edited by gits; Dec 17 '19, 09:04 AM. Reason: use code tags!

    Comment

    Working...