samedi 2 avril 2022

How to write an event for multiple checkbox.Checked?

I am building a plumbing services windows form that has three checkboxes, each with different totals representing the type of service. If two or more were checked how would I combine their totals so they can be displayed in a designated text box rather than just displaying the individual amount.

        private void apprenticeCheck_CheckedChanged(object sender, EventArgs e)
        {
            double apprenticeCost;
            apprenticeCost = 55.00 + CALLOUT_AMOUNT;

            if (apprenticeCheck.Checked)
                serviceTotalText.Text = apprenticeCost.ToString("C");



Aucun commentaire:

Enregistrer un commentaire