1 Replies - 1181 Views - Last Post: 09 October 2012 - 09:56 PM Rate Topic: -----

#1 k3nnt0ter0  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 181
  • Joined: 16-January 10

Hosting WPF to VB.NET's ElementHost

Posted 09 October 2012 - 11:21 AM

I got this Project and I want it to embed on my vb.net form.
However, the Project was created using C# WPF. How can I host wpf to the elementhost of vb.net.

I tried to do some research and I got this:

Elementhost1.child=New samplelib.usercontrol1

After trying that, I can't make it work. I think I am missing something because when I tried to do that, after samplelib, the only code available next to it are "Resources","SampleUserControl" and "VisualTreeUtils".

This post has been edited by k3nnt0ter0: 09 October 2012 - 10:14 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Hosting WPF to VB.NET's ElementHost

#2 k3nnt0ter0  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 181
  • Joined: 16-January 10

Re: Hosting WPF to VB.NET's ElementHost

Posted 09 October 2012 - 09:56 PM

I added the WPF to VB.Net

What I did was add some reference. Next is add the WPF to Windows Form Solution and then on the Elementhost, I select hosted element the SampleUserControl.

But I got a an error. .

Quote

'Public Sub New()' is obsolete'This constructor should not be used'.

at line
Me.SampleUserControl1 = New SampleWpfUserControlLibrary.SampleUserControl()

Posted Image

This post has been edited by k3nnt0ter0: 09 October 2012 - 10:12 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1