it will not be automatically activated since you might have processed it in the WPF control first. However, you can easily add this yourself.
In the WPF user control, output the event that you fire with the right mouse button:
public event Action ShowContext; private void rectangle1_MouseRightButtonUp(object sender, MouseButtonEventArgs e) { if (ShowContext != null) { ShowContext(); } }
Then in your winforms control using the element host you can use it like this:
public UserControl1 WpfControl { get; set; } public Form1() { InitializeComponent(); WpfControl = new UserControl1(); WpfControl.ShowContext += () => contextMenuStrip1.Show(Cursor.Position); elementHost1.Child = WpfControl; ....
source share