我有一个由面板、图片框和标签组成的“按钮”。
我已禁用图片框和标签以保持 MouseEnter(和背景颜色)处于活动状态。但是,禁用的标签具有通常的褪色文本 - 有没有办法让标签保持启用但像禁用时一样忽略鼠标事件?
Private Sub panelBackup_MouseEnter(sender As Object, e As EventArgs) Handles panelBackupButton.MouseEnter
Dim btn As Panel = DirectCast(sender, Panel)
btn.BackColor = Color.Gray
End Sub
Private Sub panelBackup_MouseLeave(sender As Object, e As EventArgs) Handles panelBackupButton.MouseLeave
Dim btn As Panel = DirectCast(sender, Panel)
btn.BackColor = Color.LightGray
End Sub