• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 354
  • Last Modified:

Class Library Toolbox Icon

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
vwalla
Asked:
vwalla
1 Solution
 
CodeCruiserCommented:
0
 
Kalpesh ChhatralaSoftware ConsultantCommented:
i am facing same type of issue. i tried variety of solution but nothing work.
0
 
vwallaAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Kalpesh ChhatralaSoftware ConsultantCommented:
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
 
vwallaAuthor Commented:
Cool!  Hope it helps others out there.
0
 
vwallaAuthor Commented:
I searched the hell out of Google all day!
0
 
ArkCommented:
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now