Skale
asked on
Displaying specific project's form in solution for selected treeview node in vb.net
Hello,
I've similar topic before and find a solution with help of friends in following topic.
And this is after node sleect event to show selected user control.
Private Sub ToolNavigationAfterSelect( sender As Object, e As TreeViewEventArgs) Handles treToolNavigation.AfterSel ect
For Each ctrl As Control In IndexModuleTools.Panel2.Co ntrols.Cas t(Of Control).Reverse()
ctrl.Dispose()
IndexModuleTools.Panel2.Co ntrols.Rem ove(ctrl)
Next
Dim dynType As Type = CType(e.Node.Tag, Type)
Dim instance As Control = CType(Activator.CreateInst ance(dynTy pe), Control)
instance.Dock = DockStyle.Fill
IndexModuleTools.Panel2.Co ntrols.Add (instance)
instance.Show()
End Sub
--- NOW --- i'd like to show Windows.Forms of another project which is included my solution but i don't know how it would be possible?
Any helps would be grateful.
I've similar topic before and find a solution with help of friends in following topic.
Displayin specific UserControl for selected node in vb.nethttps://www.experts-exchange.com/questions/29142992/Displayin-specific-UserControl-for-selected-node-in-vb-net.html
Dim controls = GetType(GUI).Assembly.GetTypes.Where(Function(t) t.BaseType.Equals(GetType(UserControl)))
For Each element in treToolNavigation.Nodes.Cast(Of TreeNode)
element.Tag = controls.FirstOrDefault(Function(t) t.Name.StartsWith(element.Text))
Next
And this is after node sleect event to show selected user control.
Private Sub ToolNavigationAfterSelect(
For Each ctrl As Control In IndexModuleTools.Panel2.Co
ctrl.Dispose()
IndexModuleTools.Panel2.Co
Next
Dim dynType As Type = CType(e.Node.Tag, Type)
Dim instance As Control = CType(Activator.CreateInst
instance.Dock = DockStyle.Fill
IndexModuleTools.Panel2.Co
instance.Show()
End Sub
--- NOW --- i'd like to show Windows.Forms of another project which is included my solution but i don't know how it would be possible?
Any helps would be grateful.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.