Visual Studio C# Application

I seem to have everything defined with no errors but am unable to get the program to respond when entering data into the form.  The form looks like this http://screencast.com/t/aO3aCrcvH and the code is pasted below.  Is there anything obvious that I have I missed?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _304_PennerT_Lab03
{
    public partial class stadiumSeatingForm : Form
    {
        public stadiumSeatingForm()
        {
            InitializeComponent();
        }

        private void calculateRevenueButton_Click(object sender, EventArgs e)
        {
            // Declare Named Constants
               
                const decimal CLASS_A_SEATS = 15.00m; const decimal CLASS_B_SEATS = 12.00m; const decimal CLASS_C_SEATS = 9.00m;
            
            // Declare Varialbles
               
                decimal classATickets; decimal classBTickets; decimal classCTickets;
                decimal classARevenue; decimal classBRevenue; decimal classCRevenue;
            
            // Convert Text Box Values (which are string values) to the appropriate data type using a Parse method and assign to related variable.
               
                classATickets = decimal.Parse(classATicketsSalesBox.Text); classBTickets = decimal.Parse(classATicketsSalesBox.Text); classCTickets = decimal.Parse(classCTicketsSalesBox.Text);
            
            // Process Calculations
               
                classARevenue = classATickets * CLASS_A_SEATS; classBRevenue = classBTickets * CLASS_B_SEATS; classCRevenue = classCTickets * CLASS_C_SEATS;
            
            // Display Numeric Output to appropriate control by converting the numeric value to a string using the ToString method.
               
                classARevenueBox.Text = classARevenue.ToString("c"); classBRevenueBox.Text = classBRevenue.ToString("c"); classCRevenueBox.Text = classCRevenue.ToString("c");
        }
        private void clearButton_Click(object sender, EventArgs e)
        {
            // Clear form and set focus
               
                classATicketsSalesBox.Text = " "; classBTicketsSalesBox.Text = " "; classCTicketsSalesBox.Text = " ";
                classARevenueBox.Text = " "; classBRevenueBox.Text = " "; classCTicketsSalesBox.Text = " ";
                totalRevenueBox.Text = " ";
        }

        private void exitButton_Click(object sender, EventArgs e)
        {
            // Close application
                
                this.Close();
        }

        private void classATicketsSalesBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void calculateRevenueButton_Click_1(object sender, EventArgs e)
        {

        }
    }
}

Open in new window

rtod2Asked:
Who is Participating?
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
select the button
press F4 to see the properties of the button.
Select the little lightning bolt (event part of the properties)
scroll the properties to find the click event.
verify that your button click method is assigned to the click event.
See the screenshot to get an idea of how to check. button_click_event_property assigned
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Double-check that your button_click events are hooked up to the button.
0
 
rtod2Author Commented:
Can you be more specific?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
I have created button click events and thought they were hooked up as the event to call when the button is pressed, but then I go and check by looking at the properties of the button and event methods and they are not there. Just be sure the events are assigned to the button. That is the first check I would do.
0
 
rtod2Author Commented:
How do I make sure the events are assigned to the button?
0
 
NorieVBA ExpertCommented:
What happens if you double click on the buttons when you have the form in design view?

Does focus goto the existing event of the button you clicked?

eg if you double click calculateRevenueButton does it go to calculateRevenueButton_Click?
0
 
rtod2Author Commented:
imnorie, thank you

Therein must lie the problem.  When I double click on the so named calculateRevenueButton, it puts me into the section of code below named caculateRevenueButton_Click_1 instead of where it should put me.  I have attached the resulting code.  Please advise further
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _304_PennerT_Lab03
{
    public partial class stadiumSeatingForm : Form
    {
        public stadiumSeatingForm()
        {
            InitializeComponent();
        }

        private void calculateRevenueButton_Click(object sender, EventArgs e)
        {
            // Declare Named Constants
               
                const decimal CLASS_A_SEATS = 15.00m; const decimal CLASS_B_SEATS = 12.00m; const decimal CLASS_C_SEATS = 9.00m;
            
            // Declare Varialbles
               
                decimal classATickets; decimal classBTickets; decimal classCTickets;
                decimal classARevenue; decimal classBRevenue; decimal classCRevenue;
            
            // Convert Text Box Values (which are string values) to the appropriate data type using a Parse method and assign to related variable.
               
                classATickets = decimal.Parse(classATicketsSalesBox.Text); classBTickets = decimal.Parse(classATicketsSalesBox.Text); classCTickets = decimal.Parse(classCTicketsSalesBox.Text);
            
            // Process Calculations
               
                classARevenue = classATickets * CLASS_A_SEATS; classBRevenue = classBTickets * CLASS_B_SEATS; classCRevenue = classCTickets * CLASS_C_SEATS;
            
            // Display Numeric Output to appropriate control by converting the numeric value to a string using the ToString method.
               
                classARevenueBox.Text = classARevenue.ToString("c"); classBRevenueBox.Text = classBRevenue.ToString("c"); classCRevenueBox.Text = classCRevenue.ToString("c");
        }
        private void clearButton_Click(object sender, EventArgs e)
        {
            // Clear form and set focus
               
                classATicketsSalesBox.Text = " "; classBTicketsSalesBox.Text = " "; classCTicketsSalesBox.Text = " ";
                classARevenueBox.Text = " "; classBRevenueBox.Text = " "; classCTicketsSalesBox.Text = " ";
                totalRevenueBox.Text = " ";
        }
        private void exitButton_Click(object sender, EventArgs e)
        {
            // Close application
                
                this.Close();
        }

        private void calculateRevenueButton_Click_1(object sender, EventArgs e)
        {

        }
    }
}

Open in new window

0
 
NorieVBA ExpertCommented:
Try doing what xdJR1875 but also click the dropdown button.

That should give you a list which should include clearButton_Click, which obviously you should select.

Do the same for the other buttons.
0
 
rtod2Author Commented:
He sees a Click property which I do not.  I click the button and press F4.  I get properties but not a Click property.  I am using the latest version of Visual Studio.  Is there a way to upload the files here?
0
 
NorieVBA ExpertCommented:
At the bottom(or top) of the property sheet you should see a small lightning strike.

Click that to see the events.
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
Step 3 of my post above shows how to get to the click event and do those things.
0
 
rtod2Author Commented:
Lightning bolt.  Got it.  Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.