Hi,
I wrote a extension for VS2010 some time ago. After learning that it may have still use, published it, even I'm not fully satisfied with it's look.
I'm talking about a toolbar that has button for every web browser installed on your machine. You can push the button and next time your web application will run in the selected browser.
I have two questions...
The buttons created dynamically like this:
private void BeforeQueryStatus ( object sender, EventArgs e )
{
OleMenuCommand oOleMenuCommand = ( OleMenuCommand )sender;
if ( oOleMenuCommand != null )
{
int nIndex = oOleMenuCommand.CommandID.ID - ( int )Consts.BrowsersListButton;
oOleMenuCommand.Checked = nIndex == _Current;
oOleMenuCommand.Text = ( ( BrowserCaps )_Browsers[ nIndex ] ).DisplayName;
}
}
Where
_Browsers
is a list of the browsers found on your machine...
My problem is that I prefer to display images and not names, but found no way to add image to the button, dynamically, from external source...
The other problem is connected to the customization of toolbar. Like VS built-in toolbars, my one also subject to custom re-design. I do not want this. In the vsct file I declared the toolbar and the button with no-customize option:
<Menu guid="CMD_SET" id="BrowsersListToolbar" type="Toolbar" priority="0">
<Parent guid="CMD_SET" id="BrowsersListToolbar" />
<CommandFlag>NoCustomize</CommandFlag>
<Strings>
<ButtonText>Web Browser Selector</ButtonText>
</Strings>
</Menu>
<Button guid="CMD_SET" id="BrowsersListButton" type="Button" priority="0">
<Parent guid="CMD_SET" id="BrowsersListGroup" />
<CommandFlag>DynamicItemStart</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>IconAndText</CommandFlag>
<CommandFlag>NoButtonCustomize</CommandFlag>
<Strings>
<ButtonText>[Browsers List]</ButtonText>
</Strings>
</Button>
This seems do nothing...
There are some suggestions?
Thanks
Peter