当我悬停/点击按钮时,如何更改此按钮的背景颜色?这是图像: http://i.minus.com/ib0pWwQBJ6nlW9.JPG
答案 0 :(得分:0)
尝试添加此内容:
Private Sub button1_MouseHover(sender As Object, e As EventArgs)
Me.button1.BackColor = Color.Transparent
End Sub
Private Sub button1_MouseLeave(sender As Object, e As EventArgs)
Me.button1.BackColor = Color.Blue
End Sub
<强>(OR)强>
nextBtn.FlatAppearance.MouseOverBackColor=Color.Transparent
查看here
答案 1 :(得分:0)
在Web表单加载事件上更容易
oggetto
是您案例中的按钮
dim oggetto as object
oggetto.Attributes.Add("onmouseover",this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='transparent'")
然后将其放回鼠标中
oggetto.Attributes.Add("onmouseout",this.style.backgroundColor=this.originalstyle;")