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

  • Home
  • SEARCH
  • 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 8722109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:20:11+00:00 2026-06-13T07:20:11+00:00

I am currently working with clicking count and textBox values. Button1 purpose is to

  • 0

I am currently working with clicking count and textBox values. Button1 purpose is to execute an specific function depending on the value that texbox7 has. I am not getting any results when I try firing the button click event. Can someone suggest/help ?

Code

    private List<string> messages = new List<string>() { "Option1", "Option2", "Option3", "Option4" };
  private void button1_Click(object sender, EventArgs e)
  {

    if (textBox7.ToString() == "Option1")
                {
                    int min = max;
                    int n = 0;
                    string s = "";

                    sw.Start();


                }
                else if (textBox7.ToString() == "Option2")
                {
                }
                else if (textBox7.ToString() == "Option3")
                {
                }
                else if (textBox7.ToString() == "Option4")
                {
                }
                else if (textBox7.ToString() == "")
                {
                    MessageBox.Show("Please input information");
                }
       }
  • 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-13T07:20:12+00:00Added an answer on June 13, 2026 at 7:20 am

    Instead of

    if (textBox7.ToString() == "Option1")
    

    it should be

    if (textBox7.Text == "Option1")
    

    You should compare with the value inside the TextBox, and you can get that using Text property of the textbox.

    Your textBox7.ToString() will give you something like System.Windows.Forms.TextBox, Text: text. Because of that you are not getting into any check. Compare your values against the Text property and it should work.

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

Sidebar

Related Questions

Currently working with converting SQLException error messages into messages that are more useful for
Im currently working on a game that uses multi touch to apply zoom to
Am currently working on an application that requires users to submit posts and comments
I am currently working on this application(C#,WPF,LINQ2XML,.NET 4.0) that displays details for 'Animals'. An
I'm currently working on a project that requires the user to annotate (or comment)
Currently I am working on one form which contains 2 buttons. Clicking on 1
I'm currently working on something that is probably done in plenty of examples out
I am currently working on media player. When I am clicking the next button
I'm currently working on a website which main function is to search a relatively
I'm currently working on a program in WinForms that will require a lot of

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.