0

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.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by tfj
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

Edited by codeorder: n/a

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.