This is my program:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CountryCurrency
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void rdbRupees_Click(object sender, EventArgs e)
{
if (rdbIndia.Checked == true)
MessageBox.Show("You are right");
else
MessageBox.Show("Select proper currency");
}
private void rdbYen_Click(object sender, EventArgs e)
{
if (rdbJapan.Checked == true)
MessageBox.Show("You are right");
else
MessageBox.Show("Select proper currency");
}
private void rdbDollers_Click(object sender, EventArgs e)
{
if (rdbUSA.Checked == true)
MessageBox.Show("You are right");
else
MessageBox.Show("Select proper currency");
}
}
}
This is how form look like
so the problem is when i click on any currency to validate that it is true for the country or false for the country.
It displays message box for Yen & Rupees but didn't show any message box for Dollers.
Can anyone tell me where I am having problem in the program.
If i use CheckedChanged event it displays message box twice.
For e.g. India is already checked then if i check Rupees, message box appears once.
After that if i clicked Yen, it give me two message boxes telling me i am right first time then wrong second time.
After if i click Dollers, it give me two message boxes telling i am wrong, displaying twice.
So i used Click() but still didn't got satisfactory results .
Can anyone help me