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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:16:41+00:00 2026-06-09T13:16:41+00:00

Im working on a decimal to binary converter that works perfectly on a console

  • 0

Im working on a decimal to binary converter that works perfectly on a console and then i get these errors about my core math operations:

System.Windows.Forms.Button does not contain a definition for ToInt32 and no extension method ToInt32 accepting a first argument of type System.Windows.Forms.Button could be found (are you missing a using directive or an assembly reference?)
Line:93

No overload for method ‘ToString’ takes 2 arguments Line:94

System.Windows.Forms.Button does not contain a definition for ‘ToInt32’ and no extension method ‘ToInt32’ accepting a first argument of type ‘System.Windows.Forms.Button’ could be found (are you missing a using directive or an assembly reference?) Line:103

Here is the code:

    public void Convert_Click(object sender, EventArgs e)
    {
        string Input;
        bool IsNotBinary;
        string Answer;
        Start:
        Input = UserInput.Text;
        int InputLength = Input.Length;
        if (InputLength > 10)
        {
            UserInput.Text = "Overflow";
            goto Start;
        }
        int Int;
        bool IsANumber = int.TryParse(Input, out Int);
        if (IsANumber == false)
        {
            UserInput.Text = "Invalid Character";
            goto Start;
        }
        IsNotBinary = Input.Contains("3");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("4");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("5");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("6");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("7");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("8");
        if (IsNotBinary == true)
        {
            goto End;

        }
        IsNotBinary = Input.Contains("9");
    End:

        if (IsNotBinary == true)
        {

            // decimal to binary
            int InputInt = Convert.ToInt32(Input); // converts the string "Input" to the int "InputInt"
            Answer = Convert.ToString(InputInt, 2);
            UserInput.Text = Answer;

        }

        else
        {

            // binary to decimal
            Answer = Convert.ToInt32(Input, 2).ToString();
            UserInput.Text = Answer;

        }
        Console.ReadLine();
        goto Start;
    }

    public void QuitButton_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }        
}

}

  • 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-09T13:16:42+00:00Added an answer on June 9, 2026 at 1:16 pm

    The error message is quite clear:

    System.Windows.Forms.Button’ does not contain a definition for ‘ToInt32’

    My psychic debugger tells me that you have a class level button variable named Convert, so you’re not calling the ToInt32 method on the static Convert class as your button is hiding it. Either rename the button or fully qualify the name, i.e., System.Convert.ToInt32().

    Edit:

    Ok, I guess I didn’t need my psychic debugger after all. Your event handler tells me all I need to know:

    public void Convert_Click(...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found and modified an int-to-bin converter that seems to be working right. Then
I implemented a binary to decimal function in Haskell and am currently working on
I am working on BCD (Binary Coded Decimal) in C and in charge of
I am working currently with PHP validation of decimal values. The function works well
So I was working on a simple binary to decimal script and an error
I am working with a decimal type in my application and have to submit
I have this regex working but now need to allow numbers without the decimal
Working with an undisclosed API, I found a function that can set the number
Working with H2 I get this error when I try to write a row
I'm trying to to convert from a decimal number into a binary number. Have

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.