
Default border on a UserControl...
Hi Matt,
try the following code in your user control:
Private m_BorderStyle As Windows.Forms.BorderStyle
<System.ComponentModel.Category("Appearance")> _
Public Property BorderStyle() As Windows.Forms.BorderStyle
Get
Return m_BorderStyle
End Get
Set(ByVal Value As Windows.Forms.BorderStyle)
If Value <> m_BorderStyle Then
m_BorderStyle = Value
Me.RecreateHandle()
End If
End Set
End Property
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim cp As Windows.Forms.CreateParams = MyBase.CreateParams
Select Case m_BorderStyle
Case BorderStyle.Fixed3D
cp.ExStyle = cp.ExStyle Or &H200
Case BorderStyle.FixedSingle
cp.Style = cp.Style Or &H800000
End Select
Return cp
End Get
End Property
Quote:
> Is there a magical way to get a border property on a UserControl or do you
> need to implement it yourself?