Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Windows Form Enabling / Disabling Button Help

Connor DickinsonConnor Dickinson Member Posts: 1
in C#

Hi! I am having trouble getting my 'start' button to show when I select either of the radio boxes.

Ideally, when one of the boxes is selected, the 'start' button will enable and allow to be clicked.

Here is my code for the form, as I am relatively new to C# I'm not sure if I'm posting all of the code you need, I'll post more if required :D

    public partial class mainForm : Form
{
    public mainForm() {
        InitializeComponent();
    }

    private void label1_Click(object sender, EventArgs e) {

    }

    private void mainForm_Load(object sender, EventArgs e) {
        title.Font = new Font("Arial", 10, FontStyle.Bold);
    }

        private void startButton_Click(object sender, EventArgs e) {
        if (radioDice.Checked) {
            startButton.Enabled = true; //Activates 'start' button
            whichDiceGameForm GameForm = new whichDiceGameForm(); 
            GameForm.Show(); 
        }
        if (radioCard.Checked) {
            startButton.Enabled = true; //Activates 'start' button
            whichCardGame GameForm = new whichCardGame();
            GameForm.Show(); 
        }

    }
}
Tagged:
Sign In or Register to comment.