I am creating a ArcMap Addin, where all the toolbars will be removed from the document and then the 3 toolbars that I need will be added.
Currently I have the following code
public void getCommandBar(string val){ try { IDocument document = ArcMap.Application.Document; ICommandBars commandBars = document.CommandBars; UID toolbarUID = new UID(); toolbarUID.Value = val; ICommandBar CommandBar; CommandBar = commandBars.Find(toolbarUID, false, false) as ICommandBar; CommandBar.Dock(esriDockFlags.esriDockFloat, null); } catch (Exception ex) { MessageBox.Show(ex.Message); }}The 3 toolbars that I need added are
I have tried other random toolbars from the ArcMap ID's links and they work fine (apart from the ones I need).
Has anyone have any ideas on why the Editor and Custom toolbar are not getting added.
أكثر...
Currently I have the following code
public void getCommandBar(string val){ try { IDocument document = ArcMap.Application.Document; ICommandBars commandBars = document.CommandBars; UID toolbarUID = new UID(); toolbarUID.Value = val; ICommandBar CommandBar; CommandBar = commandBars.Find(toolbarUID, false, false) as ICommandBar; CommandBar.Dock(esriDockFlags.esriDockFloat, null); } catch (Exception ex) { MessageBox.Show(ex.Message); }}The 3 toolbars that I need added are
- Tools Toolbar - {E1F29C75-4E6B-11D2-AE2C-080009EC732A}
- Editor Toolbar - {C671B640-83B9-11D2-850C-0000F875B9C6}
- Custom toolbar (created from the addin) - {92B5228F-D2B4-9280-F6B8-E17CB587260C}
object not set to an instance of an object
even though i have got the GUID from here, my custom toolbar does not get added either (I found the GUID from the ArcID module).
I have tried other random toolbars from the ArcMap ID's links and they work fine (apart from the ones I need).
Has anyone have any ideas on why the Editor and Custom toolbar are not getting added.
أكثر...