C# 多个按钮 click 事件

[复制链接]
查看11 | 回复3 | 2008-11-15 17:56:51 | 显示全部楼层 |阅读模式
C#中多个按钮,比如A到E,5个按钮,
执行Click事件在单击F按钮时,A到E,5个按钮的visible为false
Buttona.Visible = false;
Buttonb.Visible = false;
Buttonc.Visible = false;
Buttond.Visible = false;
Buttone.Visible = false;
这样编写,按钮是从上到下依次出来,有没有一下全出来的啊?

回复

使用道具 举报

千问 | 2008-11-15 17:56:51 | 显示全部楼层
单击f事件下 设置 Buttona.Visible = false;Buttonb.Visible = false;Buttonc.Visible = false;Buttond.Visible = false;Buttone.Visible = false;就可以了!...
回复

使用道具 举报

千问 | 2008-11-15 17:56:51 | 显示全部楼层
用这样的看看 private void button1_Click(object sender,.....) { Button btnSender = (Button)sender; foreach(Control ctlTmp in this.Constrols) { if(cltTmp as Button) { if(...
回复

使用道具 举报

千问 | 2008-11-15 17:56:51 | 显示全部楼层
ButtonF.click()事件中写如下代码:{ ButtonA.visible=false; ButtonB.visible=false;ButtonC.visible=false;ButtonD.visible=false;ButtonE.visible=false;}...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行