I am working on a project that installs a small utility program and creates a custom toolbar button in Laserfiche to launch it. During uninstall, it also attempts to remove the toolbar button. It appears to succeed in removing the button, but leaves behind an empty space on the toolbar as in the picture below:
You can just drag it off of the toolbar, but I'd prefer if it removed the button cleanly. Here is the code I am using... am I forgetting a step?
using (ClientManager lfclient = new ClientManager()) { using (ToolbarManager tbMgr = lfclient.GetToolbarManager(ClientWindowType.Main)) { int i = 0; while (i < tbMgr.GetCustomToolbarButtonCount()) { btnInfo = tbMgr.GetCustomToolbarButton(i); if (btnInfo.Description == "My_Button_Name") { tbMgr.RemoveCustomToolbarButton(i); } else { i++; } } } }