954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Which form called a form

I have 3 forms: Form1, Form2 and Form99. Form1 and Form2 both call Form99.
What statement(s) does Form99 use to determine which form called it (Form1 or Form2).

Form1
Form99.Show

Form2
Form99.Show

Form99

Which form called me?

Thank You.

tfj
Newbie Poster
9 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 
Public Class frm99
    Public sNameOfForm As String = Nothing

    Private Sub frm99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox(sNameOfForm)
    End Sub
End Class

And for all other Forms:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With frm99
            .sNameOfForm = Me.Name
            .Show()
        End With
    End Sub
codeorder
Posting Virtuoso
1,915 posts since Aug 2010
Reputation Points: 255
Solved Threads: 384
 

Thank you codeorder for you reply. It's just what I needed.

tfj
Newbie Poster
9 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: