Open new form in toolwindows

2 posts, 1 answers
  1. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 25 Jan 2010 Link to this post

    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.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 
  2. Answer
    Nikolay avatar
    1802 posts

    Posted 28 Jan 2010 Link to this post

    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,
    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.
  3. DevCraft banner
Back to Top