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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:27:52+00:00 2026-06-15T17:27:52+00:00

I have this code: Button ssr = new Button(); ssr.Text = SSR; ssr.Location =

  • 0

I have this code:

Button ssr = new Button();
                ssr.Text = "SSR";
                ssr.Location = new Point(500, 5);
                ssr.Size = new Size(50, 30);
                ssr.Click += new EventHandler(ssr_Click);

And I had a method ssr_Click which wrote a “1234” on the button. That was just for testing, now the method looks like this:

private void ssr_Click(string callsign, object sender, EventArgs e)
    {
        using (var wb = new WebClient())
        {
            string url = "xxxxxxxx";
            WebRequest request = WebRequest.Create(url);
            request.Method = "POST";
            string postData = "callsign=" + callsign;
            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = byteArray.Length;
            Stream dataStream = request.GetRequestStream();
            dataStream.Write(byteArray, 0, byteArray.Length);
            dataStream.Close();
            WebResponse response = request.GetResponse();
            Console.WriteLine(((HttpWebResponse)response).StatusDescription);
            dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);
            string squawk = reader.ReadToEnd();
            System.Windows.Forms.MessageBox.Show(squawk); // !!!
            reader.Close();
            dataStream.Close();
            response.Close();
        }
    }

It is okay, it just doesn’t know the “callsign”, which makes sense, because it is defined somwhere else, so I added “string callsign” to the method parameters that when I call it, I also will give it the callsign. Since I did this, I get an error in first part of code, at line

ssr.Click += new EventHandler(ssr_Click);

it says this: No overload for ‘ssr_Click’ matches delegate ‘System.EventHandler’. It was fine before editing this method.
It is supposed to do this: someone clicks the button, it sends the callsign to the method, gets a four digit code from a .php at website, and it writes the code on the button, so I know that I will also have to edit the method so it returns a string, but first I need to solve this..
Any ideas?

  • 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-15T17:27:53+00:00Added an answer on June 15, 2026 at 5:27 pm

    EventHandler is a delegate type defined as:

    public delegate void EventHandler(object sender, EventArgs e);
    

    so your handler method must have the same signature i.e.

    private void ssr_Click(object sender, EventArgs e)
    

    In your handler, sender should be the object which raised the event, so you might be able to get the callsign data from that, alternatively you could store it in a member variable.

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

Sidebar

Related Questions

Say I have this mockup-code: button.click(function(){generateForm();} function generateForm(){ div.append(<input type='text' id='x'>); } I will
I have this code first the constructor and button click event: using System.Text; using
i have this code in the button click to show selection image when the
I have this code in the end of link button click: Response.ContentType = application/zip;
I am very new to Android development. I have this code: Button btnLaunch; btnLaunch=(Button)findViewById(R.id.btnLaunch);
I have this code: - (IBAction) checkIt:(id)sender{ NSString *button = [[(UIImageView *)sender label]text]; I
I have this code : if you try to click on Button 2 or
I have this code : Button groupsButton = (Button)findViewById(R.id.groupsButton); groupsButton.setOnClickListener(new OnClickListener() { public void
I have this code: Button give_review = (Button)findViewById(R.id.give_review); give_review.setOnClickListener(new Button.OnClickListener() { public void onClick(View
I have this click button code \$(#extractmonkeys).click(function () { \$(#grapharea).html( ); \$(#paramselection).html( ); How

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.