Click here to Skip to main content
15,867,765 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have toolStrip Control, and it has few items like toolstripButton, ToolStripDropDown button.
For ToolStripDropDownButton i am not creating any dropDown list, instead i am using contextmenu with few items.
Whenever mouseHover to this toolstripdropdownbutton i show this contextmenu.
here is sample code
C#
private void toolStripDropDownButtonOpen_MouseHover(object sender, EventArgs e)
{
    ToolStripDropDownButton btnSender = (ToolStripDropDownButton)sender;
        Point ptLowerRight = new Point(btnSender.Bounds.Right - 95, btnSender.Bounds.Bottom + 16);
        ptLowerRight = PointToScreen(ptLowerRight);
        contextMenuStrip.Show(ptLowerRight);           
        
}

I want whenever i loose focus on toolStripButtonDropDown that time this contextMenu should be closed. I have used mouseleave event for this but its not working properly.
Any help will be appreciated.
Thanks in advanced
Posted
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900