Solved

Class Library Toolbox Icon

Posted on 2014-03-20
7
342 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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
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 28

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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