How to set different border styles in picturebox in VB?

Hi,

How to set different border styles in picturebox in VB?

like:- single line,

double line, doted(...) lines and so on

Please help me as soon as poosible.

with regards
chinna

[195 byte] By [Sridhar1980] at [2008-1-29]
# 1

Try something like the following:


Public Class PictureBoxWithBorder
Inherits PictureBox

Private _BorderStyle As ButtonBorderStyle

Public Sub New()
Me._BorderStyle = ButtonBorderStyle.Solid
End Sub

Public Property BorderStyle As ButtonBorderStyle
Get
Return Me._BorderStyle
End Get
Set(ByVal value As ButtonBorderStyle)
If (value <> Me._BorderStyle) Then
Me._BorderStyle = value
MyBase.Invalidate
End If
End Set
End Property

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
ControlPaint.DrawBorder(e.Graphics, MyBase.ClientRectangle, Color.Black, Me._BorderStyle)
End Sub

End Class


DavidM.Kean at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic Language...