C# Refresh Underlying form data

Posted on 2008-11-18
Last Modified: 2012-06-27
I am working on a C# winforms application.

I have Form1 and Form2.

On Form1, I have Label1.  I open Form2 by clicking on a button on Form1 (Form1 remains open as well).

When I close Form2, or perform another method on Form2, I would like to refresh the text in Form1.Label1.

Can anyone help me with the code to do this.

Question by:jamesdean666
    LVL 26

    Expert Comment

    by:Anurag Thakur
    you need to implement delegate and event in this case
    in form2 closing event you will raise an event which will be handled by a hanlder for the event and delegate in form1
    please go through the following link as its implemeting something similar to your requirements

    all the links have my reference in them :)
    Cheers - Ragi
    LVL 1

    Expert Comment

    hi suggestion why dont u use events when u close form 2 fire an event which is handled in form1
    when the event is fired , the event handler will have code to change the label1's text
    LVL 1

    Expert Comment

    you dont need delegates only if u are passing event values can be done without delegates

    Author Comment

    I am still struggling with this.. Can you please provide some code?
    LVL 26

    Accepted Solution

    the code pieces are provided in all the 3 links i have pasted
    and i know that they are working
    LVL 1

    Expert Comment

    can you post the code snippet that you have and i can modify it to work

    Author Closing Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    jquery, aspx 10 34
    WiX Installer 2 39
    How to check if variable integer is empty? 6 37
    C# - SOLID Question 6 35
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now