Take a look at:
http://www.fawcette.com/vsm/2004_03/magazine/columns/gettingstarted/
Not sure what you are saying you tried, but don't editing your .vbproj file
in a text editor. Just create a new Class Library project. Add references
to System.Windows.Forms and System.Drawing.
Here is some code from a simple custom Label control I made. It adds to my
toolbox without error.
HTH,
Greg
Imports System.Windows.Forms
<System.Drawing.ToolboxBitmap(GetType(System.Windows.Forms.Label))> _
Public Class DisplayBox
Inherits System.Windows.Forms.Label
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
'UseMnemonic = False
End Sub
'UserControl1 overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container
End Sub
#End Region
Private m_ForeColor As System.Drawing.Color = System.Drawing.Color.Blue
Private m_BackColor As System.Drawing.Color =
System.Drawing.SystemColors.Window
Private m_BorderStyle As BorderStyle = BorderStyle.FixedSingle
<System.ComponentModel.DefaultValue(GetType(System.Drawing.Color),
"Blue")> _
Public Overrides Property ForeColor() As System.Drawing.Color
Get
Return m_ForeColor
End Get
Set(ByVal Value As System.Drawing.Color)
m_ForeColor = Value
End Set
End Property
<System.ComponentModel.DefaultValue(GetType(System.Drawing.Color),
"Window")> _
Public Overrides Property BackColor() As System.Drawing.Color
Get
Return m_BackColor
End Get
Set(ByVal Value As System.Drawing.Color)
m_BackColor = Value
End Set
End Property
<System.ComponentModel.DefaultValue(GetType(System.Windows.Forms.BorderStyle
), "FixedSingle")> _
Public Overrides Property BorderStyle() As
System.Windows.Forms.BorderStyle
Get
Return m_BorderStyle
End Get
Set(ByVal Value As System.Windows.Forms.BorderStyle)
m_BorderStyle = Value
End Set
End Property
End Class