Toolbar does not appear

Add-in Express™ Support Service
That's what is more important than anything else

Toolbar does not appear
 
Bill Sherman




Posts: 20
Joined: 2011-05-17
I am trying to build a simple IE module project as a proof of concept. The module contains a toolbar that I want to appear at all times in IE.

Everything was working correctly but suddenly the toolbar stopped appearing when I run IE.

- the toolbar class is simple, it has only one button. I am not doing anything weird with its properties.

- the toolbar is set up in the module's Toolbars collection. The properties of the toolbar entry in the toolbar collection include:
Enabled - True
LoadAtStartup - True
Position - NewRow
ToolBarType - (my toolbar class)

But when I run IE (from Start menu or in VS debug run), the toolbar does not appear. Am I missing something simple?

Thanks
Posted 17 May, 2011 10:58:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bill,

Probably you just disabled it in the 'Managed Add-ons' dialog. Please check it.
Posted 17 May, 2011 11:31:48 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
I did not use the managed add-ons dialog.
Posted 17 May, 2011 12:08:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
It is enough to click on the 'X' button to close/disable the toolbar in IE8 and later.
Posted 17 May, 2011 14:23:24 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
In case anybody is reading this thread and looking for an answer: I do not know why the toolbar became unloaded from IE in my case, but the following code from Sergey forces it to reload if it's not loaded:


internal void ShowBrowserBar(Guid g, bool bShow)
{
if (this.IEObj != null)
{
try
{
if (bShow)
{
this.IEObj.GetType().InvokeMember("ShowBrowserBar",
System.Reflection.BindingFlags.InvokeMethod,
null, this.IEObj, new object[] { g.ToString("B"), false, null });
}
this.IEObj.GetType().InvokeMember("ShowBrowserBar",
System.Reflection.BindingFlags.InvokeMethod,
null, this.IEObj, new object[] { g.ToString("B"), bShow, null });
}
catch
{
}
}
}

The 'g' parameter would be the GUID of the toolbar in this case.

Note that this does not guarantee that the toolbar will be visible if it's already loaded but hidden. In my application I need to force the toolbar to be visible in all cases, so I do this:


if (adxieToolBarItem1.ToolBarObj == null)
{
ShowBrowserBar(my_guid, true); // guid of the toolbar
}
else
{
if (!adxieToolBarItem1.ToolBarObj.Visible)
{
adxieToolBarItem1.ToolBarObj.Show();
}
}
Posted 20 May, 2011 11:26:32 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Bill,

Thank you for sharing your solution.
Posted 20 May, 2011 12:33:18 Top