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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:18:34+00:00 2026-05-23T17:18:34+00:00

I am learning the C# programming language and am making a payroll application add-on

  • 0

I am learning the C# programming language and am making a payroll application add-on for SAP business One. I have built a customized calculator that has various commands, adding, subtracting etc. I am using Visual Studio 2010.

The output “screen” is a rich textbox named ‘formula_display’.

I am able to input numbers and commands and they show properly on the formula_display from left to right i.e, 2 8 9 * <= etc

I also have input buttons for operands e.g (), <>, [] and {}

My problem:

If I type, 4 * () and then try to input some number, e.g 9 inside the brackets (by clicking inside the () in order to place the cursor there), I’m unable to do so because the the number will appear after the bracket, i.e 4 * ()9.

How do I modify my code to be able to fix the problem:

Code Snippet:

private void btn9_Click(object sender, EventArgs e)
    {
        if (inputStatus)
        {
            formula_display.Text += btn9.Text;
        }
        else
        {
            formula_display.Text = btn9.Text;
            inputStatus = true;
        }
    }

Any help appreciated. I am using Windows Forms

  • 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-23T17:18:35+00:00Added an answer on May 23, 2026 at 5:18 pm

    Try something like this in WPF:

    formula_display.SelectionLength = 0;
    formula_display.Text.Insert(formula_display.CaretIndex, btn9.Text);
    

    and something like this in WinForms:

    formula_display.SelectionLength = 0;
    formula_display.Text.Insert(formula_display.SelectionStart, btn9.Text);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning the C# programming language and am making a payroll application add-on
I am learning the C# programming language and am making a payroll application add-on
I'm currently learning the fascinating J programming language, but one thing I have not
I am learning the C# programming language and am making a Payroll program addon
I have read numerous time that learning a language such as Haskell, Lisp or
Hello everyone I am just learning my first programming language and have just corrected
Do you recommend learning C++ using a template? Edit I have basic programming language
I'm learning Python as my second programming language (my first real one if you
Duplicate of: Learning to write a compiler Documentation on creating a programming language Learning
I started learning JavaScript a while ago. It's a fairly easy programming language considering

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.