This is a migrated thread and some comments may be shown as answers.

Open new form in toolwindows

1 Answer 191 Views
Dock
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 25 Jan 2010, 09:50 PM

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.ObjectByVal 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 

1 Answer, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 28 Jan 2010, 01:53 PM
Hi bradley baker,

Thank you for the question.

All you need to do in order to dock a form in RadDock is call the DockControl method, passing the form instance as a parameter, for example:
Me.radDock1.DockControl(New Form(), Me.toolWindow2, DockPosition.Fill)

For additional information, please refer to the following article:
Docking UserControls and Forms.

If you need additional assistance, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Dock
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or