none
'Application' is not declared. It may be inaccessible due to its protection level

    Question

  • Hello

    here is my project categorization

    and i have this line in my class library project

    Application.OpenForms(0).Invoke(New EventHandler(AddressOf prin))

    and when i compile it shows me this error:

    'Application' is not declared. It may be inaccessible due to its protection level

    i googled a lot this error and found it can maybe related to application is not in the NameSpace library project.i want to know how can solve this problem?

    any help would greatly appreciated



    Friday, March 29, 2013 5:39 AM

Answers

  • Try adding a reference to System.Windows.Forms and add this line to your code: Imports System.Windows.Forms. Then Application.OpenForms(0) should be available.

    • Marked as answer by baby_2 Friday, March 29, 2013 8:39 AM
    Friday, March 29, 2013 7:24 AM

All replies

  • Click in top of solution "Show all Files" and set it to true, then you see the rest.


    Success
    Cor

    Friday, March 29, 2013 7:07 AM
  • Try adding a reference to System.Windows.Forms and add this line to your code: Imports System.Windows.Forms. Then Application.OpenForms(0) should be available.

    • Marked as answer by baby_2 Friday, March 29, 2013 8:39 AM
    Friday, March 29, 2013 7:24 AM