Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is my code. After running the program nothing happens when I click a radio button. The MouseHover code doesn't work as well. C# Programming.

Here is my code. After running the program nothing happens when I click a radio button. The MouseHover code doesn't work as well. C# Programming.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

ANumber GuessANumber.Form1 using static System.Console; Enamespace GuessANumber 3 references public partial class Formi : Form 1 reference public Form1) InitializeComponent (); /l declare variable int no, min = 1, max 5; //boolean declare bool ischeck false; 1 reference 9 1 .2 private void Forml Load(object sender, EventArgs e) 23 24 25 26 27 28 //object for random number generate Random rd new Random(O no rd. Next (min, max); O references private void Rdbtn1_Click(object sender, EventArgs e) 30 31 32 if (Rdbtn1.Checkedtrue) if(no Convert . Toint16(Rdbtn1.Text)) - 34 MessageBox.Show( You are a winner!!! 36 37 38 else ssageBox.Show( LOSER!!!) //Rdbtn1. Enabled false; Rdbtn2.Enabled- false; Rdbtn3. Enabled false; Rdbtn4.Enabled false; Rdbtn5. Enabled false; 42 46 47 1 reference private void Rdbtn1_CheckedChanged(object sender, eventArgs e) if (lischeck) 50 51 52 53 Rdbtn1.Checked false; ischeck true; 56 private void Rdbtn2 click(object sender, EventArgs e) or List Output Dashboard-Mozi Form.cs Design] GuessANumber.Form1 er 0 references private void Rdbtn2 Click(object sender, EventArgs e) if (Rdbtn2.Checked true) if (no Convert.ToInt16(Rdbtn2.Text)) MessageBox.Show"You are a winner!!!"); else MessageBox.Show("LOSER!!!") Rdbtn1.Enabled false; //Rdbtn2.Enabled false Rdbtn3.Enabled false; Rdbtn4.Enabled false; Rdbtn5.Enabled false; O references private void Rdbtn3_Click(object sender, EventArgs e) if (Rdbtn3.Checkedtrue) if (no Convert. ToInt16 (Rdbtn3.Text)) MessageBox.Show( "You are a winner!!!"); else MessageBox. Show("LOSER!!!") Rdbtn1.Enabled false; Rdbtn2. Enabled false; //Rdbtn3.Enabled false; Rdbtn4.Enabled false; Rdbtns. Enabled - false; O references private void Rdbtn4_click(object sender, EventArgs e) if (Rdbtn4.Checked true) if (no Convert.ToInt16(Rdbtn4.Text)) MessageBox.Show( "You are a winner!!!) else HessageBox.Show( "LOSER!!!"); Output 00 Dashboard- Mozill.. Forml.cs [Design] ANumber GuessANumber.Form1 MessageBox.Show("LOSER!!I") Rdbtn1.Enabled false; Rdbtn2.Enabled false; Rdbtn3.Enabled false; //Rdbtn4 , Enabled = false; Rdbtn5 . Enabled = false; O references private void Rdbtn5_Click (object sender, EventArgs e) | if (Rdbtn5 . Checked- true) if (no Convert.ToInt16 (Rdbtn5. Text)) MessageBox. Show("You are a winner!!!"); else MessageBox.Show("LOSER!!!; Rdbtn1. Enabled false; Rdbtn2. Enabled = false; Rdbtn3. Enabled false; Rdbtn4.Enabled false; //Rdbtn5. Enabled false; 0 references private void Hintlbl MouseHover (object sender, EventArgs e) if (no !-1) Hintlb1Text = "1 1s Incorrect"; else if (no -2) Hintlb1Text else if (no !-3) Hintlbl . Text else if (no !4) --2 is incorrect"; 4 "3 is incorrect"; 6 : Hintlbl.Text "4 is Incorrect"; 19 58 else Hintlbl.Text"5 is Incorrect"; Dashboard- Mozill.. Exercises 6.) Create a project named Guess AVumber with a Form that contains a guessing game with five RadioButtons numbered 1 through 5. Randomly choose one of the RadioButtons as the winning button. When the user clicks a RadioButton, display a message indicating whether the user is right. Add a Label to the Form that provides a hint. When the user's mouse hovers over the label, notify the user of one RadioButton that is incorrect. After the user makes a selection, disable all the RadioButtons. number that is at least min but less than max using the following statements: You can create a random Random ran = new Random(); int randomNumber; randomNumber = ran . Next (min, max); ed PickLarger with a Form that contains two randomly ch containing 100 numbers. Include two Buttons labeled "1" with 7. Create a project named

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions