VB2008 won't let me drag my lblBase class from the toolbox onto a form in design mode. Why? Is there a way around this?

Public Class lblBase
    Inherits System.Windows.Forms.Label
    'Public Sub New()
    'MyBase.new()
    ' Me.BackColor = Me.Parent.BackColor
    'End Sub
End Clas

you cant drag a class into a form, the whole idea of the Class is that you can have various functions relating to one class.

Example

Public Class MyModules

    Public Shared Function getConnectionString() As String
        getConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("TestConnectionString").ToString()
    End Function

So if i want to get the connection string for my database, i would use this code:

myModules.getConnectionString()

As you can see, MyModules is the class, getConnectionString is a function of that class.

Hope that clears it up a bit for you.

- Jordan

This question has already been answered. Start a new discussion instead.