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. Visual Basic
  4. HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm

HELP Vb.NET Cannot Inherit from System.ComponentModel.Design.CollectionEditor.CollectionForm

Scheduled Pinned Locked Moved Visual Basic
csharphelpdesigntutorial
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.
  • E Offline
    E Offline
    eatwork
    wrote on last edited by
    #1

    Hi, does anyone out there know how to create a new class that inherits form System.ComponentModel.Design.CollectionEditor.CollectionForm? I've checked online and it seems that this can be done in C#, but I can't find any resources out there that explain how to inherit this class in vb.net. Thank you in advance. C#: public class MyCollectionEditor : CollectionEditor { protected class MyCollectionForm : CollecitonEditor.CollectionForm { } } VB.Net - Does not work, error msg: "System.ComponentModel.Design.collectioneditor.collectionform is not accessible in this context because it is 'Protected'" public class MyCollectionEditor inherits CollectionEditor protected class MyCollectionForm inherits CollecitonEditor.CollectionForm end class end class eatwork

    D 1 Reply Last reply
    0
    • E eatwork

      Hi, does anyone out there know how to create a new class that inherits form System.ComponentModel.Design.CollectionEditor.CollectionForm? I've checked online and it seems that this can be done in C#, but I can't find any resources out there that explain how to inherit this class in vb.net. Thank you in advance. C#: public class MyCollectionEditor : CollectionEditor { protected class MyCollectionForm : CollecitonEditor.CollectionForm { } } VB.Net - Does not work, error msg: "System.ComponentModel.Design.collectioneditor.collectionform is not accessible in this context because it is 'Protected'" public class MyCollectionEditor inherits CollectionEditor protected class MyCollectionForm inherits CollecitonEditor.CollectionForm end class end class eatwork

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

      You can start with this:

      Imports System
      Imports System.Collections
      Imports System.Collections.Generic
      Imports System.Data
      Imports System.ComponentModel.Design ' Important!!
      Imports System.Windows.Forms ' Important!!
       
      Public Class MyCollectionEditor
      Inherits CollectionEditor
       
      Public Sub New(ByVal type As Type)
      MyBase.New(type)
      End Sub
      .
      .
      .
      Private Class MyCollectionEditorForm
      Inherits CollectionForm
       
      Public Sub New(ByVal editor As CollectionEditor)
      MyBase.New(editor)
      .
      . ' setup other form properties...
      .
      End Sub
       
      Public Sub New(ByVal type As Type)
      MyBase.New(type)
      End Sub

          Protected Overrides Function CreateCollectionForm() As CollectionForm
              Return New MyCollectionEditorForm(Me)
          End Function
      End Class
      

      End Class

      I strongly suggest picking up Lutz Roeder's .NET Reflector and examine some existing collection editors before continuing. Also, I'd keep the MSDN documentation for CollectionBase, CollectionEditor, and CollectionEditor.CollectionForm bookmarked. Keep in mind, that CollectionForm is just a normal Windows Forms Form. I wonder what you can do with that little tidbit... Dave Kreskowiak Microsoft MVP - Visual Basic

      E 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You can start with this:

        Imports System
        Imports System.Collections
        Imports System.Collections.Generic
        Imports System.Data
        Imports System.ComponentModel.Design ' Important!!
        Imports System.Windows.Forms ' Important!!
         
        Public Class MyCollectionEditor
        Inherits CollectionEditor
         
        Public Sub New(ByVal type As Type)
        MyBase.New(type)
        End Sub
        .
        .
        .
        Private Class MyCollectionEditorForm
        Inherits CollectionForm
         
        Public Sub New(ByVal editor As CollectionEditor)
        MyBase.New(editor)
        .
        . ' setup other form properties...
        .
        End Sub
         
        Public Sub New(ByVal type As Type)
        MyBase.New(type)
        End Sub

            Protected Overrides Function CreateCollectionForm() As CollectionForm
                Return New MyCollectionEditorForm(Me)
            End Function
        End Class
        

        End Class

        I strongly suggest picking up Lutz Roeder's .NET Reflector and examine some existing collection editors before continuing. Also, I'd keep the MSDN documentation for CollectionBase, CollectionEditor, and CollectionEditor.CollectionForm bookmarked. Keep in mind, that CollectionForm is just a normal Windows Forms Form. I wonder what you can do with that little tidbit... Dave Kreskowiak Microsoft MVP - Visual Basic

        E Offline
        E Offline
        eatwork
        wrote on last edited by
        #3

        Hello Dave, Thank you for your reply, I will check out Lutz Roeders .NET reflector, and it seems as though all of the other collection editors available online are done through C#. But, I will continue the search online. I tried your starter code, but I still have the same problem. Visual Studio 2003 does not recognize: Private Class MyCollectionEditorForm Inherits CollectionForm because it says that it is protected. I was also not able to load the System.Collections.Generic library. Any ideas on why this is happening? is it because I don't have the generic library imported? Thanks eatwork

        D 1 Reply Last reply
        0
        • E eatwork

          Hello Dave, Thank you for your reply, I will check out Lutz Roeders .NET reflector, and it seems as though all of the other collection editors available online are done through C#. But, I will continue the search online. I tried your starter code, but I still have the same problem. Visual Studio 2003 does not recognize: Private Class MyCollectionEditorForm Inherits CollectionForm because it says that it is protected. I was also not able to load the System.Collections.Generic library. Any ideas on why this is happening? is it because I don't have the generic library imported? Thanks eatwork

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

          That's beause I'm using 2005, not 2003. They may have changed the CollectionForm protection between .NET 1.x and 2.0. There is, also, no System.Collections.Generic namespace in .NET 1.x, so you don't have to include it. Dave Kreskowiak Microsoft MVP - Visual Basic

          E 1 Reply Last reply
          0
          • D Dave Kreskowiak

            That's beause I'm using 2005, not 2003. They may have changed the CollectionForm protection between .NET 1.x and 2.0. There is, also, no System.Collections.Generic namespace in .NET 1.x, so you don't have to include it. Dave Kreskowiak Microsoft MVP - Visual Basic

            E Offline
            E Offline
            eatwork
            wrote on last edited by
            #5

            Thanks for your quick response dave. You wouldn't happen to know how to get around the protection problems with the CollectionForm in VS2003 would you? Thank you. eatwork

            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