Class Library Toolbox Icon

Posted on 2014-03-20
Last Modified: 2014-04-01
I cannot seem to figure out how to add an icon to my class library so when a user adds it to their tool box there is a custom icon versus the purple gear.  Please see the attached project (VS 2010) and see what I'm doing wrong.

Question by:vwalla
LVL 83

Expert Comment

ID: 39944780
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 39944835
i am facing same type of issue. i tried variety of solution but nothing work.

Accepted Solution

vwalla earned 0 total points
ID: 39946665
I finally wrapped my head around this.  Here's the code:

Namespace CustomGrid
    <ToolboxBitmap(GetType(MyGridControl))> _
    Public Class MyGridControl
        Inherits GridControl
        Protected Overrides Function CreateDefaultView() As BaseView
            Return CreateView("MyGridView")
        End Function
        Protected Overrides Sub RegisterAvailableViewsCore(ByVal collection As InfoCollection)
            collection.Add(New MyGridViewInfoRegistrator())
            collection.Add(New MyBandedGridViewInfoRegistrator())
        End Sub

    End Class
End Namespace

Open in new window

Name the .bmp  like : CustomGrid.MyGridControl.bmp in the solution exploer (see image).  Works!
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 39946829
Thanks for solution. I  added solution in my blog. so it will help to someone else.

Author Comment

ID: 39946836
Cool!  Hope it helps others out there.

Author Closing Comment

ID: 39955476
I searched the hell out of Google all day!
LVL 27

Expert Comment

ID: 39968611
You can name bitmap as you want, using overloaded method of ToolboxBitmap attribute constructor:
<ToolboxBitmap(GetType(MyGridControl),"YourBitmapName.bmp")> _

Open in new window


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now