打印本文 打印本文 关闭窗口 关闭窗口
自定义控件--xp风格按钮(可设置文字颜色)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数8779  更新时间:2009/4/25 0:44:49  文章录入:mintao  责任编辑:mintao
my_OnMouseLeave

        Height = 23        

Width = 75

    End Sub

 

 

    Protected Overrides Sub OnPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)

        ''''pevent.ClipRectangle指在其中绘制的矩形,即使用父控件的背景色来画这个矩形按钮

        pevent.Graphics.FillRectangle(New SolidBrush(Me.Parent.BackColor), pevent.ClipRectangle)

        If (Enabled = False) Then

            ''''画不可用状态

            DrawDisableButton(pevent.Graphics)

        ElseIf (my_mouseDown) Then ''''画鼠标按下状态

            DrawMouseDownButton(pevent.Graphics)

        ElseIf (my_mouseHover) Then ''''画鼠标移动到其上状态

            DrawMouseHoverButton(pevent.Graphics)

        ElseIf (Focused) Then ''''有焦点,但鼠标未移动到其上

      

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 

打印本文 打印本文 关闭窗口 关闭窗口