Solved

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

Posted on 2010-11-16
1
546 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 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now