Add all Public Assembly Form Type : Assembly « Reflection « VB.Net

4.Data Structure
5.Data Types
7.Date Time
10.File Directory
13.Internationalization I18N
14.Language Basics
16.Network Remote
20.Windows Presentation Foundation
21.Windows System
VB.Net » Reflection » AssemblyScreenshots 
Add all Public Assembly Form Type
Add all Public Assembly Form Type
Imports System
Imports System.Drawing
Imports System.Reflection
Imports System.Windows.Forms

public class MainClass

   Shared Sub Main()
      Dim form1 As Form = New Form1
   End Sub

End Class

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()

        'This call is required by the Windows Form Designer.

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is NothingThen
            End If
        End If
    End Sub
    Friend WithEvents treeView1 As System.Windows.Forms.TreeView

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()
        Me.treeView1 = New System.Windows.Forms.TreeView()
        Me.treeView1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom_
                    Or System.Windows.Forms.AnchorStyles.Left_
                    Or System.Windows.Forms.AnchorStyles.Right)
        Me.treeView1.ImageIndex = -1
        Me.treeView1.Location = New System.Drawing.Point(816)
        Me.treeView1.Name = "treeView1"
        Me.treeView1.SelectedImageIndex = -1
        Me.treeView1.Size = New System.Drawing.Size(448200)
        Me.treeView1.Sorted = True
        Me.treeView1.TabIndex = 0
        Me.AutoScaleBaseSize = New System.Drawing.Size(513)
        Me.ClientSize = New System.Drawing.Size(467248)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.treeView1})
        Me.Name = "Form1"
        Me.Text = "View Direct Members of Objects"

    End Sub

#End Region

    Private Function StripType(ByVal s As StringAs String
        Dim spacepos As Integer
        spacepos = InStr(s, " ")
        If spacepos > Then Return Mid$(s, spacepos + 1)
        Return (s)
    End Function

    Private Sub Form1_Load(ByVal sender As Object, _
        ByVal e As System.EventArgsHandles Me.Load

        Dim asm As [Assembly]
        Dim asmtypes() As Type
        Dim ThisType As Type
        asm = Reflection.Assembly.GetAssembly(GetType(System.Windows.Forms.Form))
        asmtypes = asm.GetTypes()
        For Each ThisType In asmtypes
            If ThisType.IsClass And ThisType.IsPublic Then
                Dim tn As New TreeNode(ThisType.Name)
            End If
    End Sub

End Class

Related examples in the same category
1.View all Assembly Form Type in a TreeView all Assembly Form Type in a Tree
2.View all Assembly Form Type and its members in a Tree
3.Find Members with Binding FlagsFind Members with Binding Flags
4.Get Assembly Member type: Property or Member Get Assembly Member type: Property or Member
5.Load all Types in one AssemblyLoad all Types in one Assembly
6.Get Class Name in Current AssemblyGet Class Name in Current Assembly
7.Get Executing AssemblyGet Executing Assembly
8.Get Information from AssemblyGet Information from Assembly
9.Get info for current AppDomain
10.Hook into DomainUnload event
11.Programmatically make a new app domain
12.Assembly Class represents an assembly
13.The AssemblyName type can be used to parse the full name
14.Create an object from the assembly, passing in the correct number and type of arguments for the constructor
15.Get the version of the executing assembly (that is, this assembly).
16.Get the version of the current application.
17.Get the version of a specific assembly.
18.Using AssemblyVersionAttribute
19.Create AssemblyName class with the specified display name.
20.AssemblyName.GetAssemblyName gets the AssemblyName for a given file.
21.AssemblyName.Version gets or sets the major, minor, build, and revision numbers of the assembly.
22.Assembly.FullName gets the display name of the assembly.
23.Assembly.GetCallingAssembly returns the Assembly of the method that invoked the currently executing method.
24.Assembly.GetExecutingAssembly gets the assembly that contains the code that is currently executing.
25.Assembly.GetExportedTypes gets the public types defined in this assembly that are visible outside the assembly.
26.Assembly.GetTypes gets the types defined in this assembly.
27.Assembly.IsDefined tells whether or not a specified attribute has been applied to the assembly.
28.Assembly.Load loads an assembly given the long form of its name.
29.Assembly.Location Property gets the path or UNC location of the loaded file that contains the manifest.
30.The version of mscorlib.dll  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.