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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:32:19+00:00 2026-05-23T19:32:19+00:00

I am learning the C# programming language and am making a Payroll program addon

  • 0

I am learning the C# programming language and am making a Payroll program addon for SAP Business One. I have two forms and I want to pass a value from PayrollFormulaBuilder.cs to EarnDeductSetup.cs.

The PayrollFormulaBuilder is used by a user to generate a formula and is saved to a string. A user clicks on a calculator button on the EarnDeductSetup form in order to open up the PayrollFormulaBuilder form. The EarnDeductSetup form is still open but in the background. I want the generated formula to show on my EarnDeductSetup form (I have a textbox, txt_formula_template.Text) as soon as a user clicks on an ‘Apply button on the PayrollFormulaBuilder form. i would also like for this PayrollFormulaBuilder form to close as soon as the apply button is pressed.

Right now, I am unable to show the generated formula on my EarnDeductSetup form

My Code: (EarnDeductSetupForm)

namespace EIM_Payroll_Application
{
    public partial class EarnDeductSetupForm : Form
    {
        private SAPbobsCOM.Company company;

        public string SAPCodePD { get; set; }

        public EarnDeductSetupForm(SAPbobsCOM.Company co)
        {
            InitializeComponent();
            this.company = co;
        }

...

private void btn_calculator_Click(object sender, EventArgs e)
        {
            PayrollFormulaBuilder PC = new PayrollFormulaBuilder();
            PC.ShowDialog();
        }

…

    if (rb_calculated_amt.Checked == true)
    {
        txt_formula_template.Text = SAPUtility._formulaVariable;

        formulaTemplate = txt_formula_template.Text;
    }

SAPUtility.cs

namespace Payroll.Util.Helpers
{
    public static class SAPUtility
    {
        public static string _formulaVariable = String.Empty;

        public static string variable
        {
            get { return _formulaVariable; }
            set { _formulaVariable = value; }
        }

...

PayrollFormulaBuilder.cs

private void btnApply_Click(object sender, EventArgs e)
{
    SAPUtility._formulaVariable = formula_display.Text;

    this.Close();

    EarnDeductSetupForm.ActiveForm.ShowDialog();
}

My question is, how do I get this formula to show on my txt_formula_template.Text textbox on my EarnDeductSetupForm as soon as a user presses apply on the PayrollFormulaBuilder form?

  • 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-23T19:32:20+00:00Added an answer on May 23, 2026 at 7:32 pm

    Set the button in the parent form to internal, then use the parent or parentform property in the dialog to access it, by casting it to the parent for type (this should expose the internal button with intellisense). Call ShowDialog with “this” as parameter (no quotes).

    Subscribe to events on the internal button the parent form, in the child dialog. And do your thing in the event handler.

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

Sidebar

Related Questions

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 application add-on
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 have recently started learning Ruby, as my first programming language. I feel comfortable
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
I'm learning C with The C Programming Language (K&R). Since I don't particularly want
Hello everyone I am just learning my first programming language and have just corrected
Duplicate of: Learning to write a compiler Documentation on creating a programming language Learning

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.