Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Show a menu when the drop down arrow of a 'split' toolbar button is clicked

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensions.Net
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Fri May 04, 2007 6:38 am    Post subject: HOWTO: Show a menu when the drop down arrow of a 'split' toolbar button is clicked

To add a split drop down button to the toolbar, override the NSEFolder.GetToolbarButtons method and use following sample code:

Code:
public override ShellToolbarButton[] GetToolbarButtons()
{
    return new ShellToolbarButton[] {
        new ShellToolbarButton("DropDown Button", ShellToolbarButtonType.SplitDropDown)
    };
}



To show a menu when the drop down arrow of a 'split' toolbar button is clicked, override the NSEFolder.OnExecuteFrameCommand method and use the following code:

Code:
public override void OnExecuteFrameCommand(ExecuteFrameCommandEventArgs e)
{

if (e.ToolbarButtonIndex == mySplitButtonIndex)
{
if (Utils.IsToolbarButtonDropDownAreaClicked(this))
{
ContextMenu ctx = new ContextMenu();
ctx.MenuItems.Add("Menu item");
Control dummy = new Control();
dummy.Size = new Size(0, 0);
dummy.CreateControl();
dummy.Visible = true;
Rectangle r = Utils.GetClickedToolbarButtonBounds(this);
ctx.Show(dummy, r.Location);
dummy.Dispose();
}
}
}
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensions.Net All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group