1

I just started learning WPF, and I've been trying to add this WPF control to a regular WinForm.

I know I can use Forms.Integration.ElementHost to host WPF controls in a WinForm. But as StatusStrip takes Items and not Controls it's marking the ElementHost as incompatible.

Do I need to replace the entire StatusStrip with WPF ToolBar for this to work?

Glitch
  • 595
  • 6
  • 18

1 Answers1

1

You can use ToolStripControlHost to add any control to the strip. For example for an element host which hosts a wpf user control, you can use this code:

var host = new ToolStripControlHost(this.elementHost1);
this.statusStrip1.Items.Add(host);
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398