I want to change the color of the button
when it is pressed in windows form
app and I want to use the color codes. Is there a way to make button
color #C0C0C0 ??
Asked
Active
Viewed 451 times
-2

Mehmet Topçu
- 1
- 1
- 16
- 31

mfatihk
- 136
- 2
- 11
-
take a look at [this answer](https://stackoverflow.com/a/2243439/6170890) – Nino Jul 05 '17 at 08:22
2 Answers
1
You can use rgb equivalent.Color spaces of #c0c0c0
RGB = 192 192 192
button1.ForeColor= Color.FromArgb(192, 192, 192);

Mehmet Topçu
- 1
- 1
- 16
- 31
0
This may help you..
<script>
function changeCol(btnid){
document.getElementById(btnid).style.backgroundColor = "#ff00F0";
}
</script>
<input type = "button" id = "btn" value="$alt1" onClick="changeCol('btn')">

pritam
- 21
- 6