Solved

Class Library Toolbox Icon

Posted on 2014-03-20
7
336 Views
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.

Thanks!
CustomGridView.zip
0
Comment
Question by:vwalla
7 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39944780
0
 
LVL 16

Expert Comment

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

Accepted Solution

by:
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)
            MyBase.RegisterAvailableViewsCore(collection)
            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!
Capture.PNG
0
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.

http://kalpesh2804.blogspot.in/2014/03/class-library-toolbox-icon.html
0
 
LVL 1

Author Comment

by:vwalla
ID: 39946836
Cool!  Hope it helps others out there.
0
 
LVL 1

Author Closing Comment

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

Expert Comment

by:Ark
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

0

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