Solved

Class Library Toolbox Icon

Posted on 2014-03-20
7
334 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

17 Experts available now in Live!

Get 1:1 Help Now