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
Re: Super classing the "label" control blues 80 80

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

Re: Super classing the "label" control blues 80 80

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

Re: Super classing the "label" control blues 80 80

No problem :)

- Jordan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.