?
Solved

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

Posted on 2010-11-16
1
Medium Priority
?
581 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:vcharles
1 Comment
 
LVL 32

Accepted Solution

by:
Erick37 earned 2000 total points
ID: 34149139
The Load event is fired once the form is called into memory.  I will not be fired again unless the form is closed (unloaded) and opened again.

Perhaps you could make a public method in the form that your buttons can call to do the work for you.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question