`Element Host` is a `Windows Forms control` that can be used to host a Windows Presentation Foundation (`WPF`) element.
Questions tagged [elementhost]
120 questions
1
vote
2 answers
wpf richtextbox in winforms application
I would like to use a WPF RichTextBox in a WinForms project written with VB
I have created the WinForms project with one form and a button
I then added a new project WPF User Control Library placed a WPF RichTextBox on the WPF form
I added…

Vector
- 3,066
- 5
- 27
- 54
1
vote
1 answer
Focus border outside an ElementHost is not being displayed
I'm using an ElementHost to host a WPF custom control in a WinForms app. The control has a thick border which should be visible when the control has focus. The border is "outside" the control, i.e, has a negative margin.
The problem is that the…

narduk
- 964
- 1
- 9
- 19
1
vote
0 answers
Black Screen appears while maximizing winform which has ElementHost as child
I added ElementHost as child to winform. While maximizing window, black screen appears before showing form.
public Form1()
{
InitializeComponent();
System.Windows.Forms.Integration.ElementHost host = new
…

Amk
- 23
- 2
1
vote
1 answer
WinForms ElementHost slows down with repeated use
I have a scenario where using WPF as part of a modeless dialog drastically out-performs the alternatives. However, what I'm seeing is that each time I bring up the dialog, it gets a little slower, until eventually it takes up to 20 seconds to bring…

jpwkeeper
- 321
- 2
- 10
1
vote
0 answers
Embed Windows form panel in WPF control
I'm trying to design fancy WPF controls for Windows desktop application.
I'm wondering if it is possible to expose an embedded panel in a WPF control.
The idea is to create a panel with a entitled ribbon. A button will be used to deploy or hide…

LokiQan
- 73
- 7
1
vote
0 answers
C# Child WinForm with elementhost distorts Parent Form in 150% display
I'm trying to use an elementhost in my child form but it distorts my parent form. Tried to refresh and minimize/maximize the parent form but doesn't work. Take note this only happens when I'm in 150% display resolution. (you will need to change to…

Ric
- 11
- 5
1
vote
0 answers
How to show relative source image on WPF hosted by WinForm Project without modifying behind code?
I made WinForm project and add ElementHost for using WPF blend effect on some Images.
ElementHost m_host = new ElementHost();
WPF_TK4S wpfTK4S = new WPF_TK4S();
m_host.Child = wpfTK4S;
m_host.Size = new Size(1000, 1000);
m_host.Location = new…

KimSJ
- 133
- 4
1
vote
2 answers
Autosize of WPF Elementhost in WinForms not working properly
Made an dummyapp to illustrate a problem I have with a real world application:
I have a WPF User Control with content like this:
1
vote
2 answers
Using Mahapps.Metro Flyouts in Elementhost
I'm writing a SolidWorks addin, where I can host WPF only within an Winforms Elementhost. Now I want to use a Flyout from Mahapps.Metro, which depens on being hosted in a MetroWindow. Is there any way I can use the Flyout from within a WPF…

Ksdmg
- 397
- 5
- 15
1
vote
2 answers
VSTO passing variables to ActionPane and WPF usercontrol /ElementHost
first of all, It is a document based VSTO project (so those add-in VSTO walkthroughs don't really work).
I was able to create an ActionPaneControl and was able to add a WPF usercontrol in it using ElementHost.
Code to launch it as the…

Heisenberg
- 764
- 6
- 20
1
vote
1 answer
MediaElement in ElementHost Windows Form C#
I'm trying to create a simple MediaPlayer, but I need to mute left/right audio channels, so I have to use MediaElement. I got the following error when I tried to add the player to the ElementHost:
Error CS1503 Argument1: impossible to convert…

Marco Zanaboni
- 47
- 5
1
vote
0 answers
Unable to set imagePath and text into button user control from windows form
I am new in wpf user controls, i am trying to create a user control as button which has the half portion .png image and rest have text.
I have designed my user control but unable to set the image and text from windows form. I am invoking my user…

Ashish-BeJovial
- 1,829
- 3
- 38
- 62
1
vote
1 answer
WinForm Hosted in WPF Mouse.getPosition not working
I have some element (ZedGraph) hosted in a wpf Window.
I want to get the x and the y coordinate of my mousecursor.
It works on the rest of the window but as soon as I hover over the Elementhost the numbers are frozen.
I already found out that…

Andre P
- 123
- 1
- 8
1
vote
1 answer
Picture not changing in WPF Control
i referred this, wrote almost same code but in different langauge, its not working as expected!
i'm using winform(C++/Cli) as host & 'WPF User Control Libaray'(C#) as a child control. integrated WPF user control(PictureBox) in winforms using…

Prakash M
- 659
- 1
- 12
- 36
1
vote
1 answer
How to use ContentPresenter with ElementHost
I have
three WPF UserControls with their Viewmodels
one WPF container for displaying one of the WPF Usercontrols
WinForm Usercontrol
I want: display different WPF UserControl, which I set is in WinForms User Control
public partial class…

streamdown
- 390
- 4
- 17