How do you add a BaseCommand to a custom BaseToolbar as an icon and text?
This is not an Add-In, it's the old way of doing buttons and toolbars even though it's version 10 of ArcMap.
I didn't try the solution in the thread below but it looks correct to me: How to show caption and icon for basecommand
Depending on how your toolbar is setup, the check for Enabled() can happen frequently. You may want to add a boolean flag to keep the SetAsIconAndText() function from constantly running.
You need to create a toolbar class, IToolbarDef, to reference your BaseCommand icons to. Then create a resource bitmap and reference it in your BaseCommand class, see example below:
Public Sub New() MyBase.New() MyBase.m_category = "Developer Samples" MyBase.m_caption = "Export Active View VisualBasic .NET" MyBase.m_message = "Exports the Active View using VisualBAsic .NET" MyBase.m_toolTip = "Export PDFs" MyBase.m_name = Me.GetType().Name + "" Try 'load the bitmap resource (the icon for this tool). Dim bitmapResourceName As String = Me.GetType().Name + ".bmp" MyBase.m_bitmap = New Bitmap(Me.GetType(), bitmapResourceName) Catch ex As Exception System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap") End Try End Sub