让UserControl能显示焦点状态

'set the control can display the focus status 
    Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
        MyBase.OnGotFocus(e)
        Me.BorderStyle = Windows.Forms.BorderStyle.FixedSingle
    End Sub
    Protected Overrides Sub OnLostFocus(ByVal e As System.EventArgs)
        MyBase.OnLostFocus(e)
        Me.BorderStyle = Windows.Forms.BorderStyle.None
    End Sub
posted @ 2014-07-22 11:03  龍☆  阅读(418)  评论(0编辑  收藏  举报