WPF Interop Problem

Stimulsoft Reports.NET discussion
Post Reply
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

WPF Interop Problem

Post by Andreas Tastler »

Hi all

We started using Stimulsoft Reports with the winforms components. Now our main application will be migrated to WPF, but the reporting components should still be running by winforms (we did a lot of extensions in toolbar and menu). We have other components that still run with winforms.
When I start the Designer in dialog mode StiReport.Design(true) everything is working fine. But if I start the Designer non modal StiReport.Design(false), strange things with keyboard and menu happened.
Example 1: Deleting selected components by the DEL-Key is not working
Example 2: I open a menu entry in main menu, then I click on the desinger space or select a component, but the menu stays open

I tried this with an completely new WPF Application with a button on it. The click event contains the following basic code:

Code: Select all

StiReport stiReport = new StiReport();
stiReport.Design(false);
Can you help me with this problem?

Thank you
Andreas
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

WPF Interop Problem

Post by Jan »

Hello,

Unfortunately this problem can't be fixed. We have faced with this problem some years ago. This is how work WinForms in WPF environment. WPF application have own "message loop" and some messages from WinForms control is ignored. For example - keyboard events.

Thank you.
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

WPF Interop Problem

Post by Andreas Tastler »

Hi Jan

I found the following Method, which activates the interoperability between WPF and NonModal Windows Forms.
It has to be called before the WinForms windows will be opened and everything will be fine...

Code: Select all

System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();
http://msdn.microsoft.com/en-us/library ... terop.aspx


Thank you for your hint...
Andreas

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

WPF Interop Problem

Post by Jan »

Hello Andreas,

Thank you for your information.

Post Reply