更改按钮的外观。 [英] Change the look of a button.

查看:48
本文介绍了更改按钮的外观。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


你能拿一个按钮,颜色为绿色,让用户点击它,将

颜色改为红色,到显示它已被选中。如果是这样,怎么样?


一如既往,提前谢谢!


Rudy

Hello all,

Can you take a button, color it green, have the user click on it, change the
color to red, to show it has been selected. IF so, how?

As always, thank in advance!

Rudy

推荐答案

Rudy,


也许它可以更短但是这个工作

\\\

如果Button1.BackColor.ToArgb = Color.Red.ToArgb那么

Button1.BackColor = Color.Green

否则

Button1.BackColor = Color.Red

结束如果

///

我希望这有帮助吗?


Cor
Rudy,

Maybe it can shorter however this works
\\\
If Button1.BackColor.ToArgb = Color.Red.ToArgb Then
Button1.BackColor = Color.Green
Else
Button1.BackColor = Color.Red
End If
///
I hope this helps?

Cor


Rudy,


也许它可以更短但是这个工作

\\\

如果Button1.BackColor.ToArgb = Color.Red.ToArgb那么

Button1.BackColor = Color.Green

Else

Button1.BackColor = Color.Red

结束如果

///

我希望这有帮助吗?


Cor
Rudy,

Maybe it can shorter however this works
\\\
If Button1.BackColor.ToArgb = Color.Red.ToArgb Then
Button1.BackColor = Color.Green
Else
Button1.BackColor = Color.Red
End If
///
I hope this helps?

Cor


" Rudy" <儒** @ discussions.microsoft.com> schrieb:
"Rudy" <Ru**@discussions.microsoft.com> schrieb:
你可以拿一个按钮,把它染成绿色,让用户点击它,将
颜色改为红色,以显示它已被选中。如果是这样,怎么样?
Can you take a button, color it green, have the user click on it, change
the
color to red, to show it has been selected. IF so, how?




\\\

DirectCast(发件人,控制).BackColor = Colors.Red

///


-

Herfried K. Wagner [MVP]

< URL:http ://dotnet.mvps.org/>



\\\
DirectCast(sender, Control).BackColor = Colors.Red
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


这篇关于更改按钮的外观。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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