winforms-interop

Dynamic Application-level resources are not dynamic when hosted in ElementHost

I'm hosting a WPF UserControl in a WinForms container. Now, I want to be able to theme/skin the UserControl. To do this, I've got several resource dictionaries that define the "skins." When my app starts up I create a "new System.Windows.Application()" so that Application.Current exists. To change the theme the old skin is removed an...

C# Winforms-WPF interop

Currently I have a Winforms app which relies on transpareny effects. However this is proving to be an absolute pain in the preverial behind! Winforms as Im learning doesn't deal with transparency particularly well. I was wondering whether or not this would be any easier using WPF components for the transparency bit and winforms for the ...

Can I load more than one COMCTL32.dll into a process?

I'm developing an ActiveX control which (these days) is used mostly in WinForms apps. The ActiveX control has a 'property page' dialog, which can be shown programmatically using the ShowPropertyPages method on the AxHost class. This is the custom UI that can be brought up in Visual Studio to edit a control's properties. This property p...

Disable or Hide Save/Print Preview Dialog popups

I'm working with an ActiveX control placed on a winform. I'd when the user tries to save or print, it will always show a dialog box first; I'd like to either immediately close the dialog box or keep it from displaying in the first place. The control in question does not raise any events that would let me know what button they pushed, ...

Drag-and-drop modifies read-only WinForm container (plus other peculiarities of drag-and-drop)

Sampling drag-and-drop between WinForm RichTextBoxes within one application and between them and external applications revealed two interesting observations (item 1 certainly appears to be a bug; in a perfect world, item 2 would probably be as well): Some drag-and-drop operations delete the dragged text from the source container, wheth...

How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del)

Is there Any way to handle the crtl + Alt + Del Key combination. Take for instance in a quiz application (Win Forms ), the user should not be able to switch to other windows till the test is over. I'm able to capture the ctrl and alt key strokes individually, using c# standard properties. but once they user hits the del key . The contr...

how to play flash in WPF application

Hi. I have a WPF application and I want to play flash movies in it. I used the WInforms active X control as described in this link It worked partially, but now whenever I run the application it crashes saying "InvalidActiveXStateException" does anyone have an idea how to solve this? ...

Iterop Forms Toolkit validation and focus events

I have an existing VB6 application which I am slowly moving its code to DotNet, in a lot of instances this means having to use DotNet usercontrols and hosting them in the VB6 form using the Interop Forms Toolkit v2. At present the current method is to develop the usercontrol in C# and then have a VB.NET usercontrol which inherits from t...

Adding a custom context menu item to Windows Form title bar

I found a thread on MSDN that shows how to add an item to the context menu of a winform title bar. Unfortunately it does not show how to register an event with the custom menu item and I have been unable to figure out how to do it. Below is a sample app that can be copied and pasted into a new Windows Forms Application. I would appreciat...

WPF App - How to obtain a reference to the corresponding System.Windows.Forms.Form?

In my WPF Project I have a WPF Window. I want to use Sticky Windows Solution in my WPF Project. The library wants only one parameter: the System.Windows.Forms.Form object. Does it exist any way to obtain a Form object starting from a WPF Window object? ...

Can I pass data from Winforms to WPF Control?

I have a winforms app but I would like to introduce a WPF user control into the app as a taster for further WPF implementation. This control needs to receive from its Host a single piece of information, a string. How can I pass this down from the Winforms app to the hosted control? Or, indeed, can I? ...

Cannot drag activities from WPF ListBox into WorkflowView

Hello, I'm trying to host the Workflow Designer in a WPF application. The WorkflowView control is hosted under a WindowsFormsHost control. I've managed to load workflows onto the designer which is successfully linked to a PropertyGrid, also hosted in another WindowsFormsHost. WorkflowView workflowView = rootDesigner.GetView(ViewTechnol...

MFC Active-X control in a winforms window on Vista 64bit; "Class not registered Exception"

In an attempt to try to confirm another SO posters suggestion for key handling in an ActiveX control hosted on a winforms window, I tried making a bare-bones MFC ActiveX control, then placing it on a windows form. In design time the control showed up with no troubles. When running the application the dreaded "Class not registered excep...

Hosting Windows Forms controls in native windows, window class="Static"

I need to provide a Windows Forms control to a native application (Visual Studio). So I create a control and provide its handle. Then, when I check the native window using Spy++, I see that my control is wrapped in additional 'control' with window class = "Static" and title "This is a static!". I have several problems with it: Resize ...

How to hook hotkeys in winforms or WPF from a .NET 2.0 assembly?

I have assembly that targets .NET 2.0 to be compatible with a broad range of applications. When used with a desktop application (either winforms or WPF) I want to hook certain hotkeys and popup modeless dialog windows. The tricky bit is finding a solution that can be implemented under .NET 2.0 that is compatible with WPF. For winforms...

How to access winforms data from wpf interop?

There are 2 projects in my Solution. -WindowsFormsApplication8 -WpfControlLibrary1 I am using ElementHost from WPF Interoperability to host UserControl1 from the WpfControlLibrary1. _________________________ Form1 - [] x | ------------------------- .......... | label1 | // label .......... // elementHost1 // wpf...

How to convert WPF Application to WPF UserControl?

I am converting a WPF application to a similar WPF User Control. And the user control is hosted on WinForm using ElementHost. public partial class UserControl1:UserControl // public partial class Window1 : Window { private void UserControl_Loaded(object sender, RoutedEventArgs e) // Window_Loaded(object sender, RoutedEventArgs e) ...

Invoking a WPF command from a WPF-embedded Winforms control

I have a WinDataGrid class that extends from an Infragistics UltraGrid. I have embedded my WinDataGrid within a WPF usercontrol using WindowsFormHost. When rows are selected, I need to invoke a predefined DelegateCommand<IList> with my collection of selected rows. How would I go about this? As background, I have a WPF app that uses bo...

Is it possible to host a WinForm form within a WPF Form via a container/wrapper?

Is there a way to host/display a full WinForms form (not just a single control) within some sort of container or wrapper type control within a WPF form? I’m looking for something similar in concept to a virtual include from php or iframe in html. Possibly by compiling it into an OCX or DLL. ...

Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help)

I have been trying without luck to change the text of the tooltip that appears for the buttons on the main title bar of a form. In a nutshell, we have harnessed the 'Help' button for Windows Forms to have some other purpose. This is working fine. The issue is that when hovering the mouse over that button, a 'Help' tooltip appears, whi...