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

  • Home
  • SEARCH
  • 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 251391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:35:26+00:00 2026-05-11T21:35:26+00:00

I would like to update a form’s textbox in winforms with data that is

  • 0

I would like to update a form’s textbox in winforms with data that is being processed from a class file.

Example:

Class.RunProcess();

Inside of RunProcess I would like to fire an event that will update the textbox with the text that I pass in on the win form.

I know you can do this with events so I don’t have to make the textbox public or pass it into the many methods I have, I am just not quite sure how to start.

Edit:
Maybe I am just not clear.

I have a windows form with a text box on it.

I have a button that runs a process.

The process is in a class file outside of the form class.

Inside this process method I would like to be able to update the text box on the main form without having to pass the TextBox as a parameter to all the methods that I will have (I currently have 6 and will be more).

I thought I could subscribe to an event that would allow me to display a message in the text box while the processes ran in my class.

  • 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-11T21:35:26+00:00Added an answer on May 11, 2026 at 9:35 pm

    It’s probably time to consider:

    1. Databinding your textbox to your class
    2. Model/View/Presenter (MVP)

    For #1 (Databinding), you can use the INotifyPropertyChanged interface on your class and raise the event for changed properties.

    public class BusinessModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
    
        private int _quantity;
        public int Quantity
        {
            get { return _quantity; }
            set 
            { 
                _quantity = value;
                this.OnPropertyChanged("Quantity");            
            }
        }
    
        void OnPropertyChanged(string PropertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
            }
        }
     }
    

    And in your form, youcan bind the .Text property of the textBox to the object in several ways. Through the UI or in code.

    Links:

    • Bind Better with INotifyPropertyChanged
    • How to: Implement the INotifyPropertyChanged Interface

    Now, if you need to add to text that already exists such as in your example, you can either track the full text in the class or raise events from your class and respond in the form code. Tracking it in the class would be better – you really don’t want any logic in the form at all, which brings us back to binding and/or some form of MVP/MVC.

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

Sidebar

Ask A Question

Stats

  • Questions 128k
  • Answers 128k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As my own guess, I think I need to use… May 12, 2026 at 5:45 am
  • Editorial Team
    Editorial Team added an answer Try this solution: * { margin: 0; } html, body… May 12, 2026 at 5:45 am
  • Editorial Team
    Editorial Team added an answer Most thermal POS or label printers can be connected to… May 12, 2026 at 5:45 am

Related Questions

I would like to update a form's textbox in winforms with data that is
Which is the simplest way to update a Label from another Thread ? I
I'm using a form and jQuery to make a quick change on a web
I have a html form for uploading a file, which is as follows: $uploadhtml
I'm trying to get my head round this mind boggling stuff they call Database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.