0

In my WPF application, a small window is called up and displayed modally, from which the user (using drag and drop) must drag two strings onto a WEP page, which is displayed in a separate browser process. This also works very well as long as the user does not carry out further activities on the WEP page while the WPF window displayed.

public partial class WidgetWnd : Window
{
  public WidgetWnd(string WindowTitle, string UserIdent, string Password)
  {
    InitializeComponent();
  }

  private void LeftBtn_PreviewMouseMove(object sender, MouseEventArgs e)
  {
    leftBtn = sender as Button;
    if ((leftBtn != null) && (e.LeftButton == MouseButtonState.Pressed))
    {
      DragDrop.DoDragDrop(leftBtn, UserIdent, DragDropEffects.Copy);
    }
  }

  private void RightBtn_PreviewMouseMove(object sender, MouseEventArgs e)
  {
    rightBtn = sender as Button;
    if ((rightBtn != null) && (e.LeftButton == MouseButtonState.Pressed))
    {
      DragDrop.DoDragDrop(rightBtn, Password, DragDropEffects.Copy);
    }
  }

  private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  {
    e.Cancel = false;
  }
}

If the user now closes the window, or closes after he has already closed the WEB page, the WPF window and with it the entire program is blocked (no response). What's wrong with that? This does not happen in a small test program (System.Windows.Forms)!

0 Answers0