none
VB.NET for SolidWorks: Namespace or type specified in the Imports 'System.Windows.Forms.Integration' doesn't contain any public member or cannot be found.

    Question

  • Hi,

    I am following this example to learn how to use VB.NET for SolidWorks. Link: http://help.solidworks.com/2015/english/api/sldworksapi/Add_.NET_Controls_to_SolidWorks_Using_an_Add-in_Example_VBNET.htm

    It is about the following two lines...

    Imports System.Windows.Forms.Integration
    Dim ModelViewelhost As ElementHost

    I am using Visual Studio 2015 Community + Win7 and VS shows me the error message:

    BC40056 Namespace or type specified in the Imports 'System.Windows.Forms.Integration' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public
     member. Make sure the imported element name doesn't use any aliases.

    I have found something on google. For example:

    https://docs.microsoft.com/en-us/dotnet/articles/visual-basic/language-reference/error-messages/namespace-or-type-specified-in-the-imports-qualifiedelementname

    https://msdn.microsoft.com/de-de/library/system.windows.forms.integration(v=vs.110).aspx

    Because I am a very beginner to VB, so I still dont know how to solve this problem.

    Therefore I ask here if somebody could please help me out? Thanks.


    • Edited by RossJohnDe Saturday, April 1, 2017 7:28 AM Type error
    Saturday, April 1, 2017 7:20 AM

Answers

  • Hi RossJohnDe,

    You should add "WindowsFormsIntegration" in References.
    In Solution Explorer:
      [My Project] - [References] - button [Add References]  
      and make [WindowsFormsIntegration] checked 
      

    Regards,
    Ashidacchi
    • Marked as answer by RossJohnDe Saturday, April 1, 2017 4:01 PM
    Saturday, April 1, 2017 8:56 AM

All replies

  • Hi RossJohnDe,

    You should add "WindowsFormsIntegration" in References.
    In Solution Explorer:
      [My Project] - [References] - button [Add References]  
      and make [WindowsFormsIntegration] checked 
      

    Regards,
    Ashidacchi
    • Marked as answer by RossJohnDe Saturday, April 1, 2017 4:01 PM
    Saturday, April 1, 2017 8:56 AM
  • Thank you so much Ashidacchi! 
    Saturday, April 1, 2017 4:02 PM