C# 代码转 delphi
C#里combobox的SelectedIndexChanged事件代码为if(this.comboBox2.SelectedIndex==1){this.button2...
C#里combobox的SelectedIndexChanged事件代码为
if (this.comboBox2.SelectedIndex == 1)
{
this.button2.Visible = true;
this.button3.Visible = false;
}
if (this.comboBox2.SelectedIndex == 0)
{
this.button3.Visible = true;
this.button2.Visible = false;
}
在delphi里怎么写? 展开
if (this.comboBox2.SelectedIndex == 1)
{
this.button2.Visible = true;
this.button3.Visible = false;
}
if (this.comboBox2.SelectedIndex == 0)
{
this.button3.Visible = true;
this.button2.Visible = false;
}
在delphi里怎么写? 展开
2个回答
展开全部
你在界面上拽个按钮,然后在onclick事件里双击鼠标左键或者直接在按钮上双击鼠标左键,在事件中写如下代码:
if comboBox2.ItemIndex = 1 then
begin
button2.Visible := true;
button3.Visible := false;
end ;
if comboBox2.ItemIndex = 0 then
begin
button3.Visible := true;
button2.Visible := false;
end;
if comboBox2.ItemIndex = 1 then
begin
button2.Visible := true;
button3.Visible := false;
end ;
if comboBox2.ItemIndex = 0 then
begin
button3.Visible := true;
button2.Visible := false;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询