windowsformshost

WPF WindowsFormsHost VS2008 Toolbox has grayed out all the Windows Forms controls

I'm trying to use WindowsFormsHost in a WPF app so I can use some Windows Forms components. <Grid> <WindowsFormsHost> </WindowsFormsHost> </Grid> This all works ok with no errors, but when I go to drag a Windows Forms component from the toolbox in VS2008, they're all grayed out. In a way this makes sense as only the WPF compo...

WPF WindowsFormsHost sizing

I wanted to wrap a windows forms control in a wpf UserControl <UserControl x:Class="MVVMLibrary.ReportViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ws="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" ...

In WPF how can you draw a line over a WindowsFormsHost?

Here is my XAML <Grid Name="grid"> <TextBlock Text="Some Label" /> <WindowsFormsHost Name="winFormsHost"> </WindowsFormsHost> </Grid> On the load of the form I execute the following method protected void OnLoad(object sender, RoutedEventArgs e) { // Create a line on the fly Line line = new Lin...

WPF Popup and WindowsFormsHost Problem.

Hi, I am hosting windowsforms control in WPF popup. Problems below: If i make StaysOpen=False i can't interact with winform control. StaysOpen to false is required because when clicked outsidet the Popup region, it should close. if i make StaysOpen=True i can interact with winform control but when i click outside the area of popup, it...

Using SetWindowTheme() on controls in WindowsFormsHost in WPF?

I have an application I'm developing which closely mirrors Windows 7's Device Stage. In Device Stage, beneath the main banner there is a ListView containing actions embodied as ListViewItems. In my WPF application, I used WindowsFormsHost to host a WinForms ListView so that I could use SetWindowTheme() on it and apply Windows Vista/7 st...

Instantiate a Windows Forms control in WPF without default constructor

I am trying to host a custom Windows Forms control in WPF. My custom control does not have a public constructor, and it has a static Create() method which looks something like this: public abstract class MyCustomControl : UserControl { internal MyCustomControl(...) { } public static MyCustomControl Create(SomeEnum kind) { sw...

WindowsFormsHost Winform pdfviewer control problem

Hello, I have a wpf Usercontrol, inside i am using a Winforms pdfviewer to display pdf files. Also i have couple of Textboxes to enter document details. finally, A popup which display this user control. The problem is, when i try to type something in textboxes, ntn is happenning. when i right click on a textbox, i can see context menu...

"Invalid Window Handle" on exiting of WPF application that uses System.AddIn

I am working on a WPF application that is using System.AddIn to solve a memory leak issue we were having with a Windows Forms based control that was wrapped in a WindowsFormsHost control. The add-in is used to load and unload the Windows Forms based control as need to avoid the overhead of the WindowsFormsHost, which will hang around unt...

Application.Idle event not firing in WPF application

I am using a third-party Windows Forms control that performs some actions "delayed" using the Application.Idle event. Now that we're moving our application to WPF, these actions stopped working. I've found that the System.Windows.Forms.Application.Idle event is not raised as expected. How can I get the Idle event to fire in a WPF appli...

WPF doesn't always repaint when using WindowsFormsHost

I have a simple application which is hosting a Managed DirectX Control using WindowsFormsHost. I've overridden the paint methods in the Control to prevent flicker: protected override void OnPaint(PaintEventArgs e) { if (this.Visible == true) { base.OnPaint(e); } } // Don't paint the background unless the control is not visible prot...

WindowsFormsHost and DependencyProperty

I've got a Windows Forms control that I'm attempting to wrap as a WPF control using the WindowsFormsHost class; I would like to bind the legacy control to a view-model. Specifically, the control exposes a grid property, GridVisible, that I would like to bind a view-model to. I'm using a private, static backing field and a static, read-on...

Wrapping with Dependency Properties

I've got a Windows Forms control that I'm wrapping with a WindowsFormsHost-derived class to access WPF's data binding functionality. The Forms control exposes properties that indicate its state, along with the standard property-changed event notifier. For example, a Zoom property on the Forms control is accompanied with a ZoomChanged ev...

Windows Form user control hosted in WPF - How to capture the leave event?

Hi, In my WPF application I'm hosting a custom Windows Form User Control together with other wpf controls. My custom user control is hosted in wpf using a WindowsFormsHost control. This custom user control contains (the parent so to speak) other custom win form controls (children controls). The children controls can be single or composi...

WPF: dynamically adding a windowsformshost control to TabControl

Hi All, I am trying to add a control to a tabcontrol in the code. I have the following: txUserControl htmlControl = new txUserControl(Utils.FileMode.Open, Utils.TxMode.Edit, 0); System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.Child = htmlControl; DockPanel panel = n...

Trap keyboard input in a WindowsFormsHost control in WPF

Hi, I have an ActiveX control inside a WinForms user control. My WinForms app loves it! Now, moving over to WPF, I use the user control in a WindowsFormsHost control. Works great..., but I want to treat this control as a single element so the user can neatly hit TAB over the existing WPF controls AND this user control NOT to 'go inside'...

Tooltips not showing through WindowsFormsHost

Hello, I have a WinForm with an infragistics grid where everything works and my tooltips are showing. Now I want to use this WinForm within a WPF application using the WindowsFormsHost class and then add this host to my WPF element and again everything works as it should, except one thing, all my tooltips are not showing. Anyone have ...

WPF TabControl with WindowsFormsHost unknown border issue

I am writing a text editor in WPF and I seem to have a strange border that I can't remove. I've got a grid with a tabcontrol, and when a user selects "File -> New", I programatically add a new tabitem to the tabcontrol. I'm setting the tabitem content to an instance of WindowsFormsHost in order to host the ScintillaNet WinForms control....

WPF TabControl / File open needs to locate child WindowsFormsHost

I'm trying to write a text editor in WPF and I have a problem trying to locate the correct instance of an editor within a TabControl in response to a File -> Open action. Tab items are added programatically and contain a WindowsFormsHost instance which in turn allows each tab to display an editor provided by the ScintillaNet WinForms co...

WPF 4: Windows Forms Host, Crystal Reports Asynch

Is there a way to render WinForms controls like Crystal Reports Viewer asynch, or even in a different thread, without freezing the applicaton. My problem is that, when I assign the report source property, the viewer tried to render the report and some reports run for so long and it freezes the whole app. Thanks in advance ...