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 9212541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:32:52+00:00 2026-06-18T01:32:52+00:00

I have the following: using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Security.Permissions;

  • 0

I have the following:

   using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Linq;
    using System.Security.Permissions;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

        namespace FarmKeeper.Forms
    {
        public partial class FarmLogs : Form
        {
            static string errorLogText = "";
            public string changedText = "";

            public FarmLogs()
            {
                InitializeComponent();

                string txtLoginLogPath = @"../../Data/LoginLog.txt";
                StreamReader readLogins = new StreamReader(txtLoginLogPath);
                txtLoginLog.Text = readLogins.ReadToEnd();
                readLogins.Close();

                loadLogs();

                changedText = errorLogText;

                txtErrorLog.Text = changedText;
            }

            public static void loadLogs()
            {
                string txtErrorLogPath = @"../../Data/MainErrorLog.txt";
                StreamReader readErrors = new StreamReader(txtErrorLogPath);
                errorLogText = readErrors.ReadToEnd();
                readErrors.Close();
            }
        }
    }

Now, what I want to do is to check if the string, changedText, changed.
I know a little about custom events but I just cannot figure this out, neither the ones on the internet.

IF changedText changed, then set another textbox to that string.

  • 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-06-18T01:32:54+00:00Added an answer on June 18, 2026 at 1:32 am

    Replace your field by a property, and check if the value changes in the setter. If it changes, raise an event. There is an interface for property changes notification called INotifyPropertyChanged:

    public class Test : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
    
        private string myProperty;
    
        public string MyProperty
        {
            get
            {
                return this.myProperty;
            }
    
            set
            {
                if (value != this.myProperty)
                {
                    this.myProperty = value;
    
                    if (this.PropertyChanged != null)
                    {
                        this.PropertyChanged(this, new PropertyChangedEventArgs("MyProperty"));
                    }
                }
            }
        }
    }
    

    Just attach an handler to the PropertyChanged event:

    var test = new Test();
    test.PropertyChanged += (sender, e) =>
        {
            // Put anything you want here, for example change your
            // textbox content
            Console.WriteLine("Property {0} changed", e.PropertyName);
        };
    
    // Changes the property value
    test.MyProperty = "test";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace
I have the following code: using System; using System.Diagnostics; using System.IO; using PdfSharp.Pdf.Printing; namespace
I have the following MonoTouch program: using System.Drawing; using MonoTouch.Foundation; using MonoTouch.UIKit; using System;
I currently have a class file with the following enumeration: using System; namespace Helper
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
i have the following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using
I have the following code in c#. using System; using System.Collections.Generic; using System.Linq; using
I have the following SQL CLR C# UDF: using System; using System.Data; using System.Data.SqlClient;
I have a model class similar to the following: using System; using System.Collections.Generic; using
I have extracted the following code from selenium IDE.(c# remote control) using System; using

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.