我想要C ++ Builder XE8的代码
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
var str = listBox1.SelectedItem.ToString();
if (str == "A")
{
textBox1.Text = "You have selected A";
}
else if (str == "B")
{
textBox1.Text = "You have selected B";
}
else
{
textBox1.Text = "You have not selected A or B";
}
}
答案 0 :(得分:0)
也许下面的C ++ Builder可能是这样的:
private:
void listBox1_SelectedIndexChanged(void *sender, EventArgs *e)
{
auto str = listBox1::SelectedItem->ToString();
if (str == "A")
{
textBox1->Text = "You have selected A";
}
else if (str == "B")
{
textBox1->Text = "You have selected B";
}
else
{
textBox1->Text = "You have not selected A or B";
}
}