鼠标移动到label控件时文字鼠标变为手型,并且文字显示灰色加下划线

private void label_1_MouseEnter(object sender, EventArgs e)
        {
            Cursor = Cursors.Hand;
            ((Label)sender).ForeColor = Color.Gray;
            ((Label)sender).Font = new Font(Var_Font, Var_Font.Style | FontStyle.Underline);
        }

        private void label_1_MouseLeave(object sender, EventArgs e)
        {
            Cursor = Cursors.Default;
            ((Label)sender).ForeColor = Color.Red;
            ((Label)sender).Font = new Font(Var_Font, Var_Font.Style);
        }

 

posted on 2013-11-15 17:13  筑梦1582  阅读(640)  评论(0编辑  收藏  举报