实验7 标签和按钮控件

这是第二次做的实验需要的代码,存下好在机房用,对了,说不定某位友友还可以用的上。那就共享

private: System::Void On_Click(System::Object^ sender, System::EventArgs^ e) {
String ^str = L”您的年龄:”;
// 获取第一个问题答案
for (int i=0;i groupBox1->Controls->Count;i++)
{
RadioButton^btn=(safe_cast
(this->groupBox1->Controls[i]));
if(btn->Checked)
{
str = String::Concat(str,this->groupBox1->Controls[2],L”\n”);
break;
}
}str=String::Concat(str,L”您使用的接入方式:”);
// 获取第二个问题答案
for (int i=0; i panel1->Controls->Count;i++)
{
RadioButton^ btn=(safe_cast
(this->panel1->Controls[i]));
if(btn->Checked)
{
str=String::Concat(str,btn->Text,L”\n”);
break;
}
}str=String::Concat(str,L”您上网主要是:\n”);
// 获取第三个问题答案
for (int i=0;i groupBox2->Controls->Count;i++)
{
CheckBox^ check=(safe_cast
(this->groupBox2->Controls[i]));
if(check->Checked)
{
str=String::Concat(str,L”\t”,check->Text,L”\n”);
}
}
MessageBox::Show(str,L”问卷调查结果”);
}
private: System::Void label1_Click(System
::Object^ sender, System::EventArgs^ e) {
}
private: System::Void On_cabnel(System
::Object^ sender, System::EventArgs^ e) {
exit(0);
}
private: System
::Void linkLabel1_LinkClicked(System
::Object^ sender, System::Windows
::Forms::LinkLabelLinkClickedEventArgs^ e) {
}
};

版权所有© HzlzH | 本文采用 BY-NC-SA 进行授权
转载需注明 转自: 《实验7 标签和按钮控件

随机文章

0 Comments.

:wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)

[ Ctrl + Enter ] Typed 0 Words 订阅评论Feed