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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Why VS designer doesn't work with sub classes ?

Why VS designer doesn't work with sub classes ?

Scheduled Pinned Locked Moved Visual Basic
visual-studiotutorialquestion
5 Posts 3 Posters 1 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
    Ky Nam
    wrote on last edited by
    #1

    Hi For example : Class Parent Private Class Child Inherits System.Windows.Forms.UserControl End Class End Class VS designer doesn't work with class Child Is there anyway to load designer for Child ?

    C 1 Reply Last reply
    0
    • K Ky Nam

      Hi For example : Class Parent Private Class Child Inherits System.Windows.Forms.UserControl End Class End Class VS designer doesn't work with class Child Is there anyway to load designer for Child ?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      No, I don't think so. Why would you want to embedd a user control class ?

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      K 1 Reply Last reply
      0
      • C Christian Graus

        No, I don't think so. Why would you want to embedd a user control class ?

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        K Offline
        K Offline
        Ky Nam
        wrote on last edited by
        #3

        I need it is Private , Child is used by Parent only

        D 1 Reply Last reply
        0
        • K Ky Nam

          I need it is Private , Child is used by Parent only

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

          The designer will not look for classes embedded in other classes. You also cannot do what you want, because the designer can't get at the private class to create an instance of it. Your UserControl class must be made Pblic for it to work in the designer. You can try breaking it out into a seperate class (both of your classes in the same file) and tagging it a Friend, but I have my doubts on it working. This is because a Friend class is visible only to other code in the same assembly, not outside the assembly. I'm guessing this would preclude the designer from seeing the class.

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

          K 1 Reply Last reply
          0
          • D Dave Kreskowiak

            The designer will not look for classes embedded in other classes. You also cannot do what you want, because the designer can't get at the private class to create an instance of it. Your UserControl class must be made Pblic for it to work in the designer. You can try breaking it out into a seperate class (both of your classes in the same file) and tagging it a Friend, but I have my doubts on it working. This is because a Friend class is visible only to other code in the same assembly, not outside the assembly. I'm guessing this would preclude the designer from seeing the class.

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

            K Offline
            K Offline
            Ky Nam
            wrote on last edited by
            #5

            Thank you very much , i have never known that "the designer can't get at the private class to create an instance of it" Actually , i want child class can use private fields and methods of parent class

            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