Results 1 to 1 of 1

Thread: Enumerate forms + hierarchical controls through reflection

Threaded View

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Enumerate forms + hierarchical controls through reflection

    here's a reflection example:

    edit:

    i spotted an error. here's the fix:

    vb Code:
    1. Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
    2.     Dim ctrl As Control = DirectCast(e.Node.Tag, Control)
    3.     SplitLabel1.ctrlName = ctrl.Name
    4.     SplitLabel1.ctrlType = If(TypeOf e.Node.Tag Is Form, ctrl.GetType.BaseType.ToString, ctrl.GetType.ToString)
    5.     PropertyGrid1.SelectedObject = ctrl
    6. End Sub
    Attached Files Attached Files
    Last edited by .paul.; Oct 28th, 2011 at 10:00 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width