C++ 生成器 XE8
如果我选择 Num 1 备忘录将显示测试
如果我选择其他项目,备忘录将显示Else Test
void __fastcall TForm1::FormCreate(TObject *Sender)
{
ListBox1->Items->Add("Num 1");
ListBox1->Items->Add("Num 2");
ListBox1->Items->Add("Num 3");
auto str = listBox1->SelectedItem->ToString();
if (str == L"Num 1") {
Memo1->Text = "Test";
}
else {
Memo1->Text = "Else Test";
}
}