here's a reflection example:
edit:
i spotted an error. here's the fix:
vb Code:
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect Dim ctrl As Control = DirectCast(e.Node.Tag, Control) SplitLabel1.ctrlName = ctrl.Name SplitLabel1.ctrlType = If(TypeOf e.Node.Tag Is Form, ctrl.GetType.BaseType.ToString, ctrl.GetType.ToString) PropertyGrid1.SelectedObject = ctrl End Sub




Reply With Quote