Results 1 to 3 of 3

Thread: Custom Control DLL Reference Greyed Out in Toolbox

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Custom Control DLL Reference Greyed Out in Toolbox

    I'm trying to add a custom panel to my toolbox using a dll file, but when I add it as a reference it only appears as greyed out - and this is only after I click "Show All" in the toolbox.

    Everything builds fine in the Class Library project I used to create the custom control. Here is the simple code:
    Code:
    Imports System.Windows.Forms
    
    Public Class pnDoubleBuffered
        Inherits Windows.Forms.Panel
        Public Sub New()
            MyBase.New()
    
            SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint, True)
            SetStyle(ControlStyles.ResizeRedraw, True)
            Me.UpdateStyles()
        End Sub
    End Class
    I build the project, open my main project where I want to use the control. Then I click "Choose All" from the toolbox and add the reference using ".NET Frameworks Components". I find my dll file and click OK. Then nothing is added to the toolbox. I manage to see the control greyed out when I click the "Show All" option.

    This is my first attempt at a dll custom control. What am I doing wrong?
    Intermediate Level Programmer Extraordinaire

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,714

    Re: Custom Control DLL Reference Greyed Out in Toolbox

    I tried and it works fine for me.
    Attached Files Attached Files
    Last edited by kareninstructor; Jul 18th, 2012 at 04:42 PM.

  3. #3

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Re: Custom Control DLL Reference Greyed Out in Toolbox

    Hmmm... I used your code and file in my project and the same thing happened BUT then tried both yours and my code and file in a NEW project and both showed up in the toolbox correctly.

    So I'm at least making progress, thanks!

    Some setting must be off in my actual project. Any ideas?
    Intermediate Level Programmer Extraordinaire

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width