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

raddock x DockingManager1

1 Answer 74 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Fabio Andrade
Top achievements
Rank 1
Fabio Andrade asked on 02 Jun 2010, 06:50 AM
Hi,

i've an old version of telerik products, now i try new version , but i have some problems.


how can i  do this in raddock:
DirectCast(mainform.DockingManager1.ActiveMdiChild, NewPtable).

'cause in raddock , when i use activemdiform, gave an error "expression does not prduce value"


and how can close tabbed when close child form.


thanks

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 07 Jun 2010, 03:20 PM
Hello Fabio,

Thank you for the question.

RadDock does not expose the active MDI child form as a property. However, you can easily get the active form by using the following code snippet:
Dim activeForm As Form = Nothing
Dim mdiChild As Form = Me.FindForm().ActiveMdiChild
Dim window As DockWindow = Me.radDock1.DocumentManager.ActiveDocument
If TypeOf window Is HostWindow Then
    Dim host As HostWindow = TryCast(window, HostWindow)
    If Not host Is Nothing Then
        If TypeOf host.Content Is Form Then
            ' this is the form in question
            activeForm = CType(host.Content, Form)
        End If
    End If
End If

If I understand your second correctly, the HostWindow that hosts a child mdi form is automatically closed when the form is closed, so you do not need to do it manually.

If you have additional questions, feel free to contact me.

Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Dock
Asked by
Fabio Andrade
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or