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. Form Inheritance

Form Inheritance

Scheduled Pinned Locked Moved C#
helpoop
5 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.
  • P Offline
    P Offline
    PHDENG81
    wrote on last edited by
    #1

    I have a project with a main form that accesses inherited forms with their appropriate .dll's. I have several that work fine. However, the latest form gives me the following error when I try to compile the main form: " "_Form() is inaccessible due to its protection level I understand what it is saying. I just dont see why. I am able to compile and run the inherited form separately with no problem. However, once I call it from my main form, I receive the previous error. Any help would be much appreciated. Thanks. D

    S 1 Reply Last reply
    0
    • P PHDENG81

      I have a project with a main form that accesses inherited forms with their appropriate .dll's. I have several that work fine. However, the latest form gives me the following error when I try to compile the main form: " "_Form() is inaccessible due to its protection level I understand what it is saying. I just dont see why. I am able to compile and run the inherited form separately with no problem. However, once I call it from my main form, I receive the previous error. Any help would be much appreciated. Thanks. D

      S Offline
      S Offline
      spif2001
      wrote on last edited by
      #2

      Is the _Form declared as protected instead of public as it should be? I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

      P 1 Reply Last reply
      0
      • S spif2001

        Is the _Form declared as protected instead of public as it should be? I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

        P Offline
        P Offline
        PHDENG81
        wrote on last edited by
        #3

        spif, Thanks for the quick response. However, the form is declared as public. public _Form(){} Any other ideas? I am assuming it isn't a user control because it would give me this error when I run the application stand-alone. What could it be? D

        P S 2 Replies Last reply
        0
        • P PHDENG81

          spif, Thanks for the quick response. However, the form is declared as public. public _Form(){} Any other ideas? I am assuming it isn't a user control because it would give me this error when I run the application stand-alone. What could it be? D

          P Offline
          P Offline
          PHDENG81
          wrote on last edited by
          #4

          spif, Thanks again for your help. You got me going in the right direction. The form was declared null within the protected override void dispose method. Thanks again for everything.

          1 Reply Last reply
          0
          • P PHDENG81

            spif, Thanks for the quick response. However, the form is declared as public. public _Form(){} Any other ideas? I am assuming it isn't a user control because it would give me this error when I run the application stand-alone. What could it be? D

            S Offline
            S Offline
            spif2001
            wrote on last edited by
            #5

            Try to write the whole namespace in front of the initialization. ex. System.Windows.Forms.Form f = new System.Windows.Forms.Form(); ^^replace with the _Form's namespace. There may be another Form with same name which is inaccesable (private or protected) I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

            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