Editing and key command in hosted window
Hello,
I sent an email to [email protected] with the same subject line as this question and I wanted to confirm receipt of the email and attached project. Thank you.
Hi Natalie,
Currently, we are validating the reported issue and will share further details
with you tomorrow.
Regards,
Sindhu Ramesh.
We were unable to reproduce the reported issue with the information provided. The page number in the toolbar is editable, and the up and down arrows scroll the page correctly on our end. For your reference, we have also attached a video demonstrating the view. If you continue to experience the issue, please modify this sample as needed and share it back with us with detailed replication steps. This will assist us in conducting a more thorough investigation.
Attachment: Video_8960d865.zip
Hello,
I have attached a video of the steps I am using to recreate this issue. In regard to the up/down arrows, I am referring to the arrows on the keyboard not on the pdf viewer. In the video, I am highlighting the page number and then pressing a number on the keyboard which does not appear to have any effect. Additionally, I am pressing the up and down arrows on the keyboard which also does nothing.
Thanks,
Natalie
Attachment: cannot_edit_bb3518be.zip
Hi Natalie,
We were able to reproduce the reported issue with the provided sample on our end, and currently we are analyzing it. We will provide further details on February 3rd, 2025.
Regards,
Yathavakrishnan M
Based on our analysis of the reported issue, the key values are being retrieved correctly in the WPF PDFViewer hosted window. However, the values are not updating properly in the UI. We can be able to reproduce the simple sample with Microsoft textbox alone. We have reported this issue to Microsoft.
Please
refer to the link below for more details:
The keyboard inputs are not
updating correctly in the hosted WinForms application - Microsoft Q&A
According to the suggestion provided in MSDN forum, the reported issue can be resolved by using the ElementHost.EnableModelessKeyboardInterop method before opening the WPF hosted window in WinForms.
To address the reported issue, please follow these steps:
- Add the <UseWindowsForms>true</UseWindowsForms> tag in the project file of the WPF project (ShowReport
project) to enable the use of the WinForms assemblies in the WPF
project.
|
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> <UseWPF>true</UseWPF> <UseWindowsForms>true</UseWindowsForms> </PropertyGroup> |
- Pass the WPF windows you have created as a parameter to the ElementHost.EnableModelessKeyboardInterop method before displaying the window, as demonstrated below:
|
using System.Windows.Forms.Integration; public partial class WpfControl : UserControl { public WpfControl() { InitializeComponent(); }
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { var window = new MainWindow(); ElementHost.EnableModelessKeyboardInterop(window); // Enable modeless keyboard interaction window.Show(); } } |
Additionally, we have modified the sample that you provided and attached below for your reference.
Attachment: ReportGeneration3_6bcce21b.zip
- 6 Replies
- 3 Participants
-
NW Natalie Westphal
- Jan 26, 2025 11:07 PM UTC
- Feb 5, 2025 12:05 PM UTC