wpf popup does not work with WindowsFromsHost RRS feed

  • Question

  • If I have a popup with windows forms control instead of a WPF control and the StaysOpen is set to 'false'. The first time I click on the windows forms control the popup closes. How can I fix this?

    void m_TestButton_Click(object sender, RoutedEventArgs e)


    Button b = sender as Button;

    Popup popup = new Popup();


    WindowsFormsHost wf_host = new WindowsFormsHost();

    wf_host.Background = SystemColors.ControlBrush;

    wf_host.Child = new UserControl1();

    popup.Child = wf_host;


    popup.Placement = PlacementMode.Right;

    popup.StaysOpen = false;

    popup.PlacementTarget = b;

    popup.Width = 250;

    popup.IsOpen = true;


    Monday, December 15, 2008 7:10 PM