Solved

Class Library Toolbox Icon

Posted on 2014-03-20
7
340 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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