I am pasting the entire code for the C# program below. As I mentioned
earlier I can follow the logic in debug mode and I can see where radiobutton5
is set to checked but it still shows radiobutton4 with the check when the
window is displayed.
namespace WindowsApplicat ion1
{
public partial class convertdate : Form
{
public string xdateformat;
public convertdate(str ing field, string dateformat)
{
InitializeCompo nent();
label2.Text = field;
xdateformat = dateformat;
if (dateformat.Com pareTo("1") == 0)
radioButton1.Ch ecked = true;
else
if (dateformat.Com pareTo("101") == 0)
{
radioButton2.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("107") == 0)
{
radioButton3.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("year") == 0)
{
radioButton4.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("month") == 0)
{
radioButton5.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("day") == 0)
{
radioButton6.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("monthna me") == 0)
{
radioButton7.Ch ecked = true;
radioButton1.Ch ecked = false;
}
else
if (dateformat.Com pareTo("dayname ") == 0)
{
radioButton8.Ch ecked = true;
radioButton1.Ch ecked = false;
}
}
private void OnCancel(object sender, EventArgs e)
{
this.Close();
}
private void OnOk(object sender, EventArgs e)
{
if (radioButton1.C hecked)
xdateformat = "1";
else
if (radioButton2.C hecked)
xdateformat = "101";
else
if (radioButton3.C hecked)
xdateformat = "107";
else
if (radioButton4.C hecked)
xdateformat = "year";
else
if (radioButton5.C hecked)
xdateformat = "month";
else
if (radioButton6.C hecked)
xdateformat = "day";
else
if (radioButton7.C hecked)
xdateformat = "monthname" ;
else
if (radioButton8.C hecked)
xdateformat = "dayname";
this.Close();
}
}
}
"Peter Duniho" wrote:
On Thu, 17 Jul 2008 18:26:02 -0700, Parrot
<Pa****@discuss ions.microsoft. comwrote:
[...]
Simply put. the system will not properly handle beyond 3 radio buttons
in the
same group. Such a simple program and I am spinning my wheels. It
couldn't
be a bug could it?
Surely it's a bug. But it's probably in your code.
Unfortunately, you haven't shared that with us. So it's not possible for
us to point it out.
If you can post a concise-but-complete code sample that reliably
reproduces the problem, it should be possible to provide a more complete
answer.
Pete