Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 913933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:38:12+00:00 2026-05-15T17:38:12+00:00

Hi all i am doing an application in win forms I am having a

  • 0

Hi all i am doing an application in win forms

I am having a small issue i.e i am having my main form as

Tree view, panel and a data grid. I am having some user control forms.

When i select a node from tree view corresponding user control will be get loaded in the panel if main form. This works good.

Now for the child nodes i am having some text files attached when i click on that i will display the data grid along with the data present in the text file. This also works fine.

But now when click on data grid cells i would like to show the data in the user control form .

Can any one tell how to handle the controls from particular user controls that was displayed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:38:12+00:00Added an answer on May 15, 2026 at 5:38 pm

    The best approach is to use event-handlers as a publisher-subscriber paradigm.
    In your publisher you use public event EventHandler FlightStarted; and having a EventArgs class:

        public class StartEventArgs: EventArgs
        {
        public String flightCode { get; private set; }
    
        public StartEventArgs(String flightCode)
        {
            this.flightCode = flightCode;
        }
    

    In your publisher class you use an OnSomething-method to fire off the event.

        public void OnFlightStarted(StartEventArgs e)
        {
            if (FlightStarted != null)
                FlightStarted(this, e);
        }
    

    Now you need to have a subscriber as well:

    flight.FlightStarted += new EventHandler(flight_FlightStarted);
    

    and the method

        void flight_FlightLanded(object sender, EventArgs e)
        {
            if (e is LandEventArgs)
            {
                LandEventArgs landEventArgs = e as LandEventArgs;
                String flight = landEventArgs.flightCode;
                while (flight.Length <= 15)
                    flight += " ";
                String time = DateTime.Now.ToLongTimeString();
                lbxStatus.Items.Insert(0, flight + "landed" 
                    + "                 " + time);
            }
        }
    

    More to read here: Event Tutorial C#

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.