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

MDI RadRibbonForm - Close all Child MDIs

1 Answer 37 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Jimmy
Top achievements
Rank 1
Jimmy asked on 12 Dec 2014, 10:23 AM
Hi,

I'm unable to close all MDI childs in once.
I've used the following code:

Public Class RadRibbonForm1
 
    Private Sub RadButtonElement1_Click(sender As Object, e As System.EventArgs) Handles RadButtonElement1.Click
        Dim childForm As New Form()
        childForm.Text = "MDI Child " & DateTime.Now.ToShortTimeString()
        childForm.MdiParent = Me
        childForm.Show()
    End Sub
 
    Private Sub RadButtonElement2_Click(sender As Object, e As System.EventArgs) Handles RadButtonElement2.Click
        Dim frmChild As Form
 
        For Each frmChild In Me.MdiChildren
            frmChild.Close()
        Next
    End Sub
 
    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
 
        ' Add any initialization after the InitializeComponent() call.
        Me.IsMdiContainer = True
 
        With Me.RadDock1
            .AutoDetectMdiChildren = True
            .ShowDocumentCloseButton = True
            .ToolWindowInsertOrder = Telerik.WinControls.UI.Docking.DockWindowInsertOrder.ToBack
        End With
    End Sub
End Class

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 17 Dec 2014, 07:41 AM
Hi Jimmy,

Thank you for writing.

You can close the windows by using the the CloseAllWindows method of the dock:
Private Sub radButton2_Click(sender As Object, e As EventArgs)
    radDock1.CloseAllWindows()
End Sub

Detailed information can be found here: Removing ToolWindow and DocumentWindow at Runtime.

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
RibbonBar
Asked by
Jimmy
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or