Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. System.Windows.Forms.Control Vs System.Windows.Controls

System.Windows.Forms.Control Vs System.Windows.Controls

Scheduled Pinned Locked Moved C#
csharpvisual-studiowpfquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kaminem
    wrote on last edited by
    #1

    Hi all, is there a way to cast a System.Windows.Controls.UserControl (.Net 3) to a System.Windows.Forms.Control (.Net2) ? I have a Plugins system and I'm trying to plug some .Net3 components Assembly l_assembly = Assembly.LoadFrom(AssemblyName); Type l_type = l_assembly.GetType(TypeName, true); Control l_itemControl = Activator.CreateInstance(l_type) as Control; here I catch an Exception when I load a "Custom Control Library (WPF)" Thanks

    D 1 Reply Last reply
    0
    • K kaminem

      Hi all, is there a way to cast a System.Windows.Controls.UserControl (.Net 3) to a System.Windows.Forms.Control (.Net2) ? I have a Plugins system and I'm trying to plug some .Net3 components Assembly l_assembly = Assembly.LoadFrom(AssemblyName); Type l_type = l_assembly.GetType(TypeName, true); Control l_itemControl = Activator.CreateInstance(l_type) as Control; here I catch an Exception when I load a "Custom Control Library (WPF)" Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      lkort wrote:

      is there a way to cast a System.Windows.Controls.UserControl (.Net 3) to a System.Windows.Forms.Control (.Net2) ?

      No, there isn't. You cannot use a .NET 3.0 component in a .NET 2.0 app. You cannot load two different versions of the .NET CLR runtime into the same process. Also, .NET 2.0 does not support WPF, so you can't do this at all. You can do the opposite though. You can load a component that was developed under .NET 2.0 in a .NET 3.0 runtime app.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      modified on Friday, February 15, 2008 10:52 AM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups