1,222
社区成员
发帖
与我相关
我的任务
分享void __fastcall TForm1::FormCreate(TObject *Sender)
{
str=new TStringList();//创建字符串列表对象
this->RadioButton1->Checked=true;
this->RadioButton2->Checked=false;//让Reg为选中
for(int i=0;i <5;i++)
{
reg=new TRegistryIniFile(HKey[i]));//创建一个注册表实例,使用缺省跟键
ComboBox1->Items->Add(HKey[i]);//将注册键添加到ComboBox1
ComboBox1->Text=HKey[0]; //为ComboBox1赋初值
TreeView1->Items->Add(NULL,HKey[i]);
Node=TreeView1->Items->Item[i];
if(reg->RegIniFile->HasSubKeys()==true)
{
reg->ReadSections(str);
for(int i=0;i <str->Count;i++)
TreeView1->Items->AddChild(Node,str->Strings[i]);
}
delete reg;
}
}