Thursday, July 21, 2016

get the control that has the context menu

MenuItem mnu = sender as MenuItem;
      
        if (mnu != null)
        {

            Button button = ((ContextMenu)mnu.Parent).PlacementTarget as Button;

No comments:

Post a Comment