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

Host window Close

2 Answers 122 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Satyajeet B
Top achievements
Rank 1
Satyajeet B asked on 22 Sep 2009, 08:29 AM

 

Hi,
I am using Telerik Raddock in my application. Within the RadDock i am openeing multiple already existing form which has a button 'Cancel'(tabbed documents). On click on Cancel button, the form will close. I am using the below code.

Dim
obj As New Form()

 

Dim hostWindow As HostWindow = RadDock1.DockControl(obj , DockPosition.Right)

 

 

RadDock1.AddDocument((hostWindow), DockPosition.Fill)

Whenever i click on Cancel button, the form is getting closed. How can i close the document in which the form is opened?
Am using ME.CLOSE() to close the form.
Similarly i also want the tabbed document to be closed.

Thanks,
Satyajeet

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Robert
Top achievements
Rank 1
answered on 22 Sep 2009, 08:52 PM
Hi Satyajeet B,

If you check for the parent of the form to be a HostWindow, you can call close on that instead and it will get rid of the tab and the form.

    Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click 
        If TypeOf Me.Parent Is HostWindow Then 
            DirectCast(Me.Parent, HostWindow).Close() 
        Else 
            Me.Close() 
        End If 
    End Sub 

- Robert
0
Satyajeet B
Top achievements
Rank 1
answered on 24 Sep 2009, 09:35 AM
thanks a lot Robert....... it works
Tags
Dock
Asked by
Satyajeet B
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Satyajeet B
Top achievements
Rank 1
Share this question
or