日期:2014-05-20 浏览次数:21022 次
Friend Class MyZKSkinLinkLabel Inherits Label Private ishover As Boolean Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) If ishover Then MyBase.ForeColor = MySkinHelper.Current.LinkHoverColor Else MyBase.ForeColor = MySkinHelper.Current.LinkColor End If MyBase.OnPaint(e) End Sub Protected Overrides Sub OnMouseEnter(e As System.EventArgs) ishover = True MyBase.ForeColor = MySkinHelper.Current.LinkHoverColor End Sub Protected Overrides Sub OnMouseLeave(e As System.EventArgs) ishover = False MyBase.ForeColor = MySkinHelper.Current.LinkColor End Sub End Class
internal class MyZKSkinLinkLabel : Label { private bool ishover; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { if (ishover) { base.ForeColor = MySkinHelper.Current.LinkHoverColor; } else { base.ForeColor = MySkinHelper.Current.LinkColor; } base.OnPaint(e); } protected override void OnMouseEnter(System.EventArgs e) { ishover = true; base.ForeColor = MySkinHelper.Current.LinkHoverColor; } protected override void OnMouseLeave(System.EventArgs e) { ishover = false; base.ForeColor = MySkinHelper.Current.LinkColor; } }