-2

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 ??

Mehmet Topçu
  • 1
  • 1
  • 16
  • 31
mfatihk
  • 136
  • 2
  • 11

2 Answers2

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