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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:30:10+00:00 2026-06-11T18:30:10+00:00

Is there a way when a user selects a choice from a radio button

  • 0

Is there a way when a user selects a choice from a radio button from a group-box to appear in a label?

It would be on the line with Quantity/Phone Type right after numberPhoneTextBox.Text.

There are a total of 3 radio-buttons for the user to choose from.

private void displayButton_Click(object sender, EventArgs e)
{
    summaryLabel.Text = "Receipt Summary\n" +
        "--------------\n" +
        "Name: " + nameTextBox.Text +
        "\nAddress: " + streetTextBox.Text +
        "\nCity: " + cityTextBox.Text +
        "\nState: " + stateTextBox.Text +
        "\nZip Code: " + zipTextBox.Text +
        "\nPhone Number: " + phoneNumberTextBox.Text +
        "\nDate: " + dateMaskedBox.Text +
        "\n-------------------------" +
        "\nQuantity/Phone Type: " + numberPhoneTextBox.Text + "/";
}
  • 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-11T18:30:11+00:00Added an answer on June 11, 2026 at 6:30 pm

    You would have to do it by hand, unfortunately. You could define a method or property that performs the task for you to avoid repetitive code, like so:

    String GetRadioButtonValue() {
             if( radioButton1.Checked ) return radioButton1.Text;
        else if( radioButton2.Checked ) return radioButton2.Text;
        else                            return radioButton3.Text;
    }
    

    UPDATE:

    Apparently the OP’s assignment “doesn’t allow the user of if/else statements” – that’s quite surreal, but you can skirt it several ways, such as using the ?: operator:

    String GetRadioButtonValue() {
        return radioButton1.Checked ? radioButton1.Text
             : radioButton2.Checked ? radioButton2.Text
                                    : radioButton3.Text;
    }
    

    Another option is to use events:

    private String _selectedRadioText;
    
    public MyForm() { // your form's constructor
        InitializeComponent();
        radioButton1.CheckedChanged += RadioButtonCheckedChanged;
        radioButton2.CheckedChanged += RadioButtonCheckedChanged;
        radioButton3.CheckedChanged += RadioButtonCheckedChanged;
        // or even:
        // foreach(Control c in this.groupBox.Controls)
        //     if( c is RadioButton )
        //         ((RadioButton)c).CheckedChanged += RadioButtonCheckedChanged;
    
        // Initialize the field
        _selectedRadioText = radioButton1.Text;
    }
    
    private void RadioButtonCheckedChanged(Object sender, EventArgs e) {
        _selectedRadioText = ((RadioButton)sender).Text;
    }
    
    // then just concatenate the _selectedRadioText field into your string
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to let user pick color from screen ? Like the
Is there a way to let user choose what icon theme to use ,
Is there any way to provide user log-in without the need for a DB.
Is there a way to use user's culture to localize the Range Validator for
is there a way to get user input like an inputbox in c#? i
Is there a way to pass user credentials over a WCF service without using
IN PHP: Is there a way for the user to fake a session variable?
In a large Application is there any way to distinguish user-defined classes with built-in
I am display text in UIWebview as there any way to enable user to
Is there any way that we can print the user name of the person

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.