Community
Just a little bump... I have the exact same problem with AutoCAD 2011 and c#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Windows;
using System.Drawing;
namespace CAD_Integrator
{
class clsStatusBar
{
private Icon mCADiIconObj = new System.Drawing.Icon("D:\\Icons\\ico-files\\ix_ap_all_add2.ico");
private Pane mCADiPaneObj = null;
private TrayItem mCADiTrayItem = null;
private TrayItemBubbleWindow mCADiTrayItemBubble = null;
private System.Windows.Forms.ContextMenu mLabelContextMenu = null;
private System.Windows.Forms.MenuItem mMenuItem_ToggleCatalogueLabels = null;
private System.Windows.Forms.MenuItem mMenuItem_ToggleOrgLabels = null;
private System.Windows.Forms.MenuItem mMenuItem_ToggleRoomLabels = null;
//private Icon mMenuItemIcon_ToggleCatalogueLabels = new System.Drawing.Icon("Images\\CreateCatalogueLabels_L.bmp");
//private Icon mMenuItemIcon_ToggleOrgLabels = new System.Drawing.Icon("Images\\CreateOrganizationLabels_L.bmp");
//private Icon mMenuItemIcon_ToggleRoomLabels = new System.Drawing.Icon("Images\\CreateRoomLabels_L.bmp");
public clsStatusBar()
{
//*******************************************************
mCADiPaneObj = new Pane();
mCADiPaneObj.Text = "CAD Integrator";
mCADiPaneObj.ToolTipText = "CAD Integrator";
mCADiPaneObj.Style = PaneStyles.NoBorders;
mCADiPaneObj.Icon = mCADiIconObj;
//*******************************************************
mCADiPaneObj.MouseDown += new StatusBarMouseDownEventHandler(vMyPaneObj_MouseDown);
//*******************************************************
Application.StatusBar.Panes.Add(mCADiPaneObj);
//*******************************************************
//*******************************************************
/*
mMenuItem_ToggleCatalogueLabels = new System.Windows.Forms.MenuItem("Display Catalogue Labels");
mMenuItem_ToggleCatalogueLabels
mMenuItem_ToggleOrgLabels = new System.Windows.Forms.MenuItem("Display Organization Labels");
mMenuItem_ToggleOrgLabels.Click += new EventHandler(mMenuItem_ToggleOrgLabels_Click);
mMenuItem_ToggleRoomLabels = new System.Windows.Forms.MenuItem("Display Room Labels");
mMenuItem_ToggleRoomLabels.Click += new EventHandler(mMenuItem_ToggleRoomLabels_Click);
* */
//*******************************************************
mLabelContextMenu = new System.Windows.Forms.ContextMenu();
mMenuItem_ToggleCatalogueLabels = mLabelContextMenu.MenuItems.Add("Display Catalogue Labels");
mMenuItem_ToggleCatalogueLabels.Click += new EventHandler(mMenuItem_ToggleCatalogueLabels_Click);
mMenuItem_ToggleCatalogueLabels.Select += new EventHandler(mMenuItem_ToggleCatalogueLabels_Click);
mMenuItem_ToggleCatalogueLabels.Disposed += new EventHandler(mMenuItem_ToggleCatalogueLabels_Click);
mMenuItem_ToggleOrgLabels = mLabelContextMenu.MenuItems.Add("Display Organization Labels");
mMenuItem_ToggleOrgLabels.Click += new EventHandler(mMenuItem_ToggleOrgLabels_Click);
mMenuItem_ToggleRoomLabels = mLabelContextMenu.MenuItems.Add("Display Room Labels");
mMenuItem_ToggleRoomLabels.Click += new EventHandler(mMenuItem_ToggleRoomLabels_Click);
//*******************************************************
//*******************************************************
mCADiTrayItem = new TrayItem();
mCADiTrayItem.ToolTipText = "CADi Tray Item";
mCADiTrayItem.Icon = mCADiIconObj;
//*******************************************************
mCADiTrayItem.MouseDown += new StatusBarMouseDownEventHandler(vMyTrayItem_MouseDown);
//*******************************************************
Application.StatusBar.TrayItems.Add(mCADiTrayItem);
//*******************************************************
//*******************************************************
mCADiTrayItemBubble = new TrayItemBubbleWindow();
mCADiTrayItemBubble.Text = "CADi Bubble Text";
mCADiTrayItemBubble.Title = "CADi Bubble Title";
mCADiTrayItemBubble.HyperLink = "http://adn.autodesk.com";
mCADiTrayItemBubble.HyperText = "CADi Hyperlink";
//*******************************************************
mCADiTrayItemBubble.Closed += new TrayItemBubbleWindowClosedEventHandler(vMyTrayItemBubble_Closed);
//*******************************************************
mCADiTrayItem.ShowBubbleWindow(mCADiTrayItemBubble);
//*******************************************************
}
private void vMyTrayItemBubble_Closed(object sender, TrayItemBubbleWindowClosedEventArgs args)
{
}
private void vMyTrayItem_MouseDown(object sender, StatusBarMouseDownEventArgs args)
{
}
private void vMyPaneObj_MouseDown(object sender, StatusBarMouseDownEventArgs args)
{
mCADiPaneObj.DisplayContextMenu(mLabelContextMenu, new Point(args.X, args.Y));
}
private void mMenuItem_ToggleCatalogueLabels_Click(object sender, EventArgs args)
{
System.Windows.Forms.MenuItem vMI = (System.Windows.Forms.MenuItem)sender;
vMI.Checked = !vMI.Checked;
//(System.Windows.Forms.MenuItem)sender.Checked = !mMenuItem_ToggleCatalogueLabels.Checked;
}
private void mMenuItem_ToggleOrgLabels_Click(object sender, EventArgs args)
{
//mMenuItem_ToggleOrgLabels.Checked = !mMenuItem_ToggleOrgLabels.Checked;
}
private void mMenuItem_ToggleRoomLabels_Click(object sender, EventArgs args)
{
//mMenuItem_ToggleRoomLabels.Checked = !mMenuItem_ToggleRoomLabels.Checked;
}
}
}
Anyone has an ideas?
Can't find what you're looking for? Ask the community or share your knowledge.