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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:55:02+00:00 2026-05-14T04:55:02+00:00

The answer to this SO question says that you can create an api by

  • 0

The answer to this SO question says that you can create an api by exposing methods, objects and .ect by setting their scope to public.
How to start creating an application API in .NET

One of the main things I want to expose is the text of a textbox. Would the best way to do this be to create a public static Text property that is updated by the textbox’s textchanged event? Also what would a developer do in order to interact with this text property while my program is running? Would they add a reference to the program .exe in their program? Then would thier program have to be in the same directory as my exe?

Please help, I’m quite clueless here. Also was not sure how to word this question, feel free it edit if it is unclear.

–Edit–

I am working on text editor. Right now I am not completely sure about everything that I want other developers to be able to interact with. One thing that I am sure I want other developers to interact with is the textbox’s text and a few labels which make up an “infobar”.

  • 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-14T04:55:03+00:00Added an answer on May 14, 2026 at 4:55 am

    Rather than creating a value which is changed by the value of the text box changing, you could create a public property which returns the current value of the text box.

    Assume you have a text box called txtUsername:

    public string GetUsername()
    {
        return txtUsername.Text;
    }
    

    A further benefit of putting them inside these types of getters is the ability to apply custom logic in a single place. For instance, in the above example, you might not care about leading and trailing spaces, and always strip them when accessing the value of the text. Rather than having to call .Trim() every time you access the text box, you can simply get the property to do it. Should requirements change and you all of a sudden do care about trailing/leading whitespace, you only have to change it in one spot (the property).

    public string GetUsername()
    {
        return txtUsername.Text.Trim();
    }
    

    Although this is a very simple example, and in a larger more complex environment there would be better ways to achieve this type of ‘business logic’.

    • 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.