求用C#编写一个单项选择题功能的程序的源代码

2024-12-21 17:43:29
推荐回答(1个)
回答1:

钮分别叫RadioButton1,RadioButton2,拖个提交按钮叫button1,拖个下一题按钮next,拖个重来按钮ag,拖个TextArea显示结果
button1.addEventListener(MouseEvent.CLICK, tijiao);
ag.addEventListener(MouseEvent.CLICK, again)

private function tijiao(e:MouseEvent):void
{
2个按钮先隐藏
next.visible = false;
ag.visible = false;
如果RadioButton1正确,RadioButton2错误
if(radioButton1.selected){
textArea.text = "正确"
next.visible = true;
}else{
textArea.text = "错误"
ag.visible = true;
}
}
private function again(e:MouseEvent):void
{
radioButton1.selected = false;
radioButton2.selected = false;
next.visible = false;
ag.visible = false;
}
另外,站长团上有产品团购,便宜有保证