D
D
Denis2012-11-29 18:29:13
.NET
Denis, 2012-11-29 18:29:13

WPF control not drawing on WinForm

Hello.

There is a simple code: Download , which displays a regular WPF control on WinForm.

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();

      ElementHost elhost = new ElementHost();
      elhost.Size = new Size(110, 60);
      elhost.Location = new Point(45,35);

      MyWPFControl wpfctl = new MyWPFControl();
      elhost.Child = wpfctl;

      this.Controls.Add(elhost);
    }
  }


I collect it on my machine (Windows 7, DirectX 11, .NET 4), run it, everything works great.
I'm running it on another machine (Windows 7, DirectX 11, .NET 4), WPF control is not drawn.

I searched on the Internet, I came across an Airspace problem. But I didn’t find a solution (I don’t have much experience with WPF).
If who faced, share experience of the decision.

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikolai Turnaviotov, 2012-11-29
@foxmuldercp

Excuse me, but why mix these technologies?
WinForms is not particularly designed for all sorts of prettiness, unlike WPF (XAML)
Draw a form in any one plane
PS After starting this project of yours, this project of yours strangely wrecked the machine
Windows 2008R2, VS 12, used to build .Net - 4.
But I have absolutely all available patches from MS on my machine.
Is it possible that all updates are installed on the problem machine?

N
Nikolai Turnaviotov, 2012-11-29
@foxmuldercp

V
Voucik, 2013-11-19
@Voucik

It seems like WPF works problematic on some processors (in my opinion, on atoms).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question