.NET Programming With Me

VB.NET : How to draw outline around a borderless form?


'Paints a thin border around the form
    Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
        MyBase.OnPaintBackground(e)

        Dim rect As New Rectangle(0, 0, Me.ClientSize.Width - 1, Me.ClientSize.Height - 1)
        e.Graphics.DrawRectangle(Pens.SkyBlue, rect)
    End Sub


P.S. Inherited from how-to-draw-outline-around-a-borderless-form

No comments: