G
gwboolean
Guest
I just learned how to build a control and had one that I wanted to build. Amazingly enough it is for a panel, for anyone who might remember my woes with that before.
So any way, I created a control using the Windows Forms Control Library, using the code below and then attempted to build it. Which resulted in the following message, instead of a BorderPanel.dll
This being all pretty new to me, I have no idea what I need to do to make this work properly, or even if it can.
Imports System.ComponentModel
Public Class BorderPanel
Inherits Panel
Public Sub New()
BorderStyle = BorderStyle.FixedSingle
BorderColor = Color.Black
_borderWidth = 2
End Sub
Private _borderWidth As Integer
<Category("Appearance")>
<Description("Border width")>
Public Property BorderWidth() As Integer
Get
Return _borderWidth
End Get
Set
_borderWidth = Math.Abs(Value)
Refresh()
End Set
End Property
Private _borderColor As Color
<Category("Appearance")>
<Description("Change border color")>
Public Property BorderColor() As Color
Get
Return _borderColor
End Get
Set
_borderColor = Value
Refresh()
End Set
End Property
Public Overridable Sub MyPanel_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
e.Graphics.DrawRectangle(New Pen(_borderColor, _borderWidth), Me.ClientRectangle)
End Sub
End Class
gwboolean
Continue reading...
So any way, I created a control using the Windows Forms Control Library, using the code below and then attempted to build it. Which resulted in the following message, instead of a BorderPanel.dll
This being all pretty new to me, I have no idea what I need to do to make this work properly, or even if it can.
Imports System.ComponentModel
Public Class BorderPanel
Inherits Panel
Public Sub New()
BorderStyle = BorderStyle.FixedSingle
BorderColor = Color.Black
_borderWidth = 2
End Sub
Private _borderWidth As Integer
<Category("Appearance")>
<Description("Border width")>
Public Property BorderWidth() As Integer
Get
Return _borderWidth
End Get
Set
_borderWidth = Math.Abs(Value)
Refresh()
End Set
End Property
Private _borderColor As Color
<Category("Appearance")>
<Description("Change border color")>
Public Property BorderColor() As Color
Get
Return _borderColor
End Get
Set
_borderColor = Value
Refresh()
End Set
End Property
Public Overridable Sub MyPanel_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
e.Graphics.DrawRectangle(New Pen(_borderColor, _borderWidth), Me.ClientRectangle)
End Sub
End Class
gwboolean
Continue reading...