Questions tagged [elementhost]

`Element Host` is a `Windows Forms control` that can be used to host a Windows Presentation Foundation (`WPF`) element.

120 questions
0
votes
0 answers

Form shown from the main UI thread is not centered within the parent but it does from a timer

I have an WPF UserControl which is embedded within an elementhost so I can show it in a winforms application. I have a class that inherits from Form.This class contains the elementhost which in turn embeds the WPF control. I am trying to center this…
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
0 answers

winforms: move a borderless form (without title bar)

I have a host class which inherits from Form. I use it to embed an WPF user control to use it in a winform application. This is customizable, I mean, you can choose to make form borderless or not. If borderless, you cannot move the window, so I need…
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
2 answers

Dynamically adding ElementHost'd WPF UserControl to WinForms results in Black

I have a WPF user control inside an ElementHost that is inside a WinForms control to wrap it. I'm dynamically adding it to a tab control tab. But when I do this, my WPF control is black. How do I fix that?
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0
votes
0 answers

Why 'The calling thread must be STA, because many UI components require this' error comes when using ElementHost in Windows Form

I am facing a issue while using WPF splash screen on a Windows Form. My splash screen is a WPF user control which is hosted on a ElementHost inside a standard Windows Form. When I add ElementHost control to the Windows Form (programmatically or…
0
votes
0 answers

WPF control not rendering properly after hosting in elementhost

The output window I have created 1 Winform in that placed one Winform user control. In user control of designer written below code. Here UC_WPF_UC1 is another user control which is having only a textblcok with width 900 and hosted this WPF user…
santhosh
  • 9
  • 3
0
votes
0 answers

WPF UserControl works in WPF app, but with BindingSource in Winforms app w/ElementHost, setters are never called

This Winforms app works fine, but I'm now trying to add a bound WPF UserControl to it via ElementHost, and my attempts at binding it have no effect. Left two thirds of screen capture are normal databound Winforms controls. Right third of screen…
amonroejj
  • 573
  • 4
  • 16
0
votes
1 answer

ElementHost DropShadowEffect

I am using ElementHost to host a WPF user control in a WinForms control. My WPF control has DropShadowEffect but it is not shown on the screen. The WPF control is flat. What do I need to do? Here is my code: public WinFormsUserControl3() { …
Metro
  • 1,121
  • 1
  • 13
  • 33
0
votes
1 answer

How to use a delegate between a Winforms Form and a WPF Usercontrol hosted by an elementhost in the Winforms form?

I have a Winforms app (class named Form_WinForms for the example) and I want to add an elementhost control to it in order to host a WPF Usercontrol (named Form_WPF). But I don't know how to handle the delegates between them: I want to exchange with…
PLB
  • 197
  • 1
  • 10
0
votes
0 answers

C# Winforms/WPF - Update Winforms Textbox if radio button ticked

I have been working AT this for two days now, the simplest one I could explain what I'm trying to do is on this website if you search for "C# - handling WPF usercontrol events in winforms". It uses a Radio Button, but the code doesn't work, I have…
0
votes
1 answer

Expose properties of a WPF control to the WinForms host

Ia have seen several similar posts (so if there is one, please guide me to it), but I haven't found any clear answers. I've got a WPF control hosted inside a Windows Forms form via ElementHost. My WPF control (let's just call it WpfControl for the…
Phonon
  • 12,549
  • 13
  • 64
  • 114
0
votes
1 answer

ElementHost hangs up, when start from Visual Studio 2017 in debug. When start it without VS no problems

Windows Forms with ElementHost hangs up, when start from Visual Studio 2017 in debug. When start it without VS no problems (same debug, like casual exe). Even empty ElementHost hangs up. Programm totally hangs up. Also, in test project with only…
rknt
  • 1
  • 1
0
votes
1 answer

.Net 4 Binding To WPF Cotrol in ElementHost (MVVM)

I've got a WPF ElementHost in a Winforms app. The User Control has some text and a TreeView which should show a tree of available commands provided by the app. I'm new to WPF (this is a learning exercise) so am having some problems binding the…
Basic
  • 26,321
  • 24
  • 115
  • 201
0
votes
1 answer

Restyle WPF Control hosted in a WinForm app

I am trying to add Dark Theme support to my hobby app. App is WinForms, and I do not want to rewrite UI in WPF. So, instead I am trying to add couple of WPF controls into my app, mainly because they allow theming of a Scrollbar. I am following…
0
votes
1 answer

Calling winforms hosting Wpf grid cause error

I have a WinForms application that acts as a service(so no actual UI), but it is a WinForms application. In this application I a form that has an ElementHost and in the elementHost I have a WPF grid. In one of my classes I have this code: Dim frm1…
Nianios
  • 1,391
  • 3
  • 20
  • 45
0
votes
1 answer

Get text from RichText wpf control hosted in elementhost on Winforms in C#

I have a winform in C# .Net 4.6 which has an element host. This hosts a usercontrol containing a WPF RichTextBox. I want to get the text from the RichTextBox to use elsewhere on the winform/application. I would like to use it as a string. I have…
Adrian Brown
  • 73
  • 1
  • 9