Avatar of Victor  Charles
Victor Charles
Flag for United States of America

asked on 

How to force Form Load event on Form2 from click event on Form1?

Hello,

I'm trying to execute different code depending on the button clicked (button 4 or 5) on Form1, but when I click on button5 to activitae the code on the Form2's Load event everything is Ok, but when I click the back button to return to Form 1 and click on the Button4 to activate the code on the Form2's Load event again, it doesn't active the Form's Load event, is there a way to form the form load event every time I access it from Form1?

Thanks,

Victor


 Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        choice = 1
        Form2.Visible = True
    End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        choice = 2
        Form2.Visible = True
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        choice = 2
        Form2.Visible = True
    End Sub
ASP.NET

Avatar of undefined
Last Comment
Erick37

8/22/2022 - Mon