如何通过点击按钮更改按钮的颜色? [英] How can I change the collor of a button by klicking at it?

查看:65
本文介绍了如何通过点击按钮更改按钮的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过点击它来改变按钮的颜色,然后我希望代码停止几秒钟,然后我们就可以了。要记住的一点是,按钮将在cood使用bin停止的秒数后隐藏。 (抱歉
拼写错误)

I wonder how I can change the collor of a button just by cklicking at it, then I want the code to stop for a few seconds and theen contiou. A thing to remeber is that the button are going to get hide after the seconds the cood have bin stoped. (sorry for bad spelling)

Windows表单应用程序 

Windows form applicationer 

推荐答案

试试这个

private async void button3_Click(object sender, EventArgs e)
{
    button3.BackColor = System.Drawing.Color.Red;
    await Task.Delay(TimeSpan.FromSeconds(4.5));
    button3.Visible = false;
}


这篇关于如何通过点击按钮更改按钮的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆