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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:39:31+00:00 2026-06-03T19:39:31+00:00

I am very new to C# and I have a problem with a homework.

  • 0

I am very new to C# and I have a problem with a homework. I have the following for a click event for some button. For the click event I want to call a function named functionA with a parameter named parameterB, a double type array. The additional parameter caused the error. What is the correct way for me to do this?

private void button1_Click(object sender, EventArgs e, double [] parameterB)
  {
      functionA(parameterB);
  }

In the corresponding section of the Designer.cs

this.button1.Location = new System.Drawing.Point(386, 309);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(174, 27);
this.button1.TabIndex = 25;
this.button1.Text = "Calculate Final Grade";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
  • 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-06-03T19:39:34+00:00Added an answer on June 3, 2026 at 7:39 pm

    You do not call button1_Click – it gets called when end-users click your button. The part of the system that detects button clicks knows how to inform your programs of the clicks using precisely one way: by calling a method with the signature

    void OnClick(object sender, EventArgs e)
    

    You cannot add to or remove arguments from the argument list, or change the return type of the method: it must match this signature precisely.

    Now back to your parameterB: you need it to make a call to the functionA method, but it does not get passed to the event handler. How do you get it then? Typically, the answer is that you store it on the instance of the object that does event handling: declare an instance variable of type double[], set it when you have enough data to set it, and pass it to functionA from inside your button1_Click method.

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

Sidebar

Related Questions

I am very new to Fluent NHibernate and I have a problem that I
Very new to JS here. When I write PHP I have no problem assigning
I have a problem using preg_match. (I'm very new to regular expressions) if(preg_match('^/http:\/\/myWebsite\.com\/', $_SERVER['HTTP_REFERER']))
I am very new to Git and I have a slight problem. In SVN
I have a very strange problem and the following code wont compile: #ifndef MYWINDOW_HPP_INCLUDED
I'm very new to .Net and WPF and have a problem. The code is
I very new to .NET and Entity Framework, and I have a problem with
I am very new to httpd server. And i have a immediate problem to
I'm very new to IOS programming and i have doubt with NSThread. My problem
I am very new to jQuery/JS and I have little problem with add or

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.