Im new to winforms and I created a ribbon form and another form1.vb that has a grid on it. So I created a button on the ribbon and I have setup some docking toolwindows and now I want to load this Form1.vb into toolwindow2 when a user click the button. Looking at the code for the BugTracker it seems there is some type of view that is created on all the sub forms. (IE my form1) so do I need to create this formview so I can load it into this window?
This is what I came up with thus far from looking at the bugtracker, and if i take out the Controls.add I do get another tab added where toolswindows2 is at. but how do i make it load form1 in it now.
Private Sub RadLabelElement1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadLabelElement1.Click |
Dim toolWindow As New ToolWindow("Unassigned Bugs") |
toolWindow.Controls.Add(Form1) |
toolWindow.CloseAction = DockWindowCloseAction.CloseAndDispose |
'by default the close action for tool windows is Hide |
'but we whant the instance of this pane to be disposed, so set the action to Close |
RadDock1.DockWindow(toolWindow, Me.ToolWindow2, DockPosition.Fill) |
End Sub |