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()
    ' 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.


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:


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

Thanks. I just added a method and it works now.