© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
10 replies
Kevin Levrone

✅ how to set the outputs to do all the math

im trying to get it to add the variebles from the variebls with the clicks to output the addition for given numbers into
a output textbox


this is my code


namespace Uber
{

    public partial class Form1 : Form
    {
        double[,] uberfares = { { 2.50, 0.18, 0.81, 2.75 }, { 5.00, 0.35, 1.55, 3.00 }, { 5.00, 0.35, 1.80, 3.60 } };

        int selectedbutton = 0;

        public Form1()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            basefareoutput.Text = selectedbutton.ToString();


        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int pickup;
            int destantion;
            int distance;
            int traveltime;
            int basefare;
            int permin;
            int perkm;
            int bookingfee;
            int totalfare;

        }

        private void textBox9_TextChanged(object sender, EventArgs e)
        {
            //   int sub = (2.50) + (quantityMin * 0.18) + (quantityBookinfee * 2.75); 



        }
        // this changes colours of buttons when clicked and other buttons colours
        private void uberxbutton_click(object sender, EventArgs e)
        {

            uberxbutton.BackColor = SystemColors.ControlDark;

            uberxlbutton.BackColor = SystemColors.Control;

            uberselectbutton.BackColor = SystemColors.Control;

            selectedbutton = 1;

        }

        private void uberxlbutton_Click(object sender, EventArgs e)
        {
            uberxlbutton.BackColor = SystemColors.ControlDark;

            uberxbutton.BackColor = SystemColors.Control;

            uberselectbutton.BackColor = SystemColors.Control;
            selectedbutton = 2;
        }

        private void uberselectbutton_Click(object sender, EventArgs e)
        {
            uberselectbutton.BackColor = SystemColors.ControlDark;

            uberxlbutton.BackColor = SystemColors.Control;

            uberxbutton.BackColor = SystemColors.Control;
            selectedbutton = 3;

        }
    }
}
namespace Uber
{

    public partial class Form1 : Form
    {
        double[,] uberfares = { { 2.50, 0.18, 0.81, 2.75 }, { 5.00, 0.35, 1.55, 3.00 }, { 5.00, 0.35, 1.80, 3.60 } };

        int selectedbutton = 0;

        public Form1()
        {
            InitializeComponent();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            basefareoutput.Text = selectedbutton.ToString();


        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int pickup;
            int destantion;
            int distance;
            int traveltime;
            int basefare;
            int permin;
            int perkm;
            int bookingfee;
            int totalfare;

        }

        private void textBox9_TextChanged(object sender, EventArgs e)
        {
            //   int sub = (2.50) + (quantityMin * 0.18) + (quantityBookinfee * 2.75); 



        }
        // this changes colours of buttons when clicked and other buttons colours
        private void uberxbutton_click(object sender, EventArgs e)
        {

            uberxbutton.BackColor = SystemColors.ControlDark;

            uberxlbutton.BackColor = SystemColors.Control;

            uberselectbutton.BackColor = SystemColors.Control;

            selectedbutton = 1;

        }

        private void uberxlbutton_Click(object sender, EventArgs e)
        {
            uberxlbutton.BackColor = SystemColors.ControlDark;

            uberxbutton.BackColor = SystemColors.Control;

            uberselectbutton.BackColor = SystemColors.Control;
            selectedbutton = 2;
        }

        private void uberselectbutton_Click(object sender, EventArgs e)
        {
            uberselectbutton.BackColor = SystemColors.ControlDark;

            uberxlbutton.BackColor = SystemColors.Control;

            uberxbutton.BackColor = SystemColors.Control;
            selectedbutton = 3;

        }
    }
}
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to find the implementation of Math. functions
C#CC# / help
4y ago
How do i set the int to 0 and set the string to empty
C#CC# / help
3y ago
syntax for c# to do this math.
C#CC# / help
2y ago
String to math
C#CC# / help
4y ago