Host window Close

3 posts, 1 answers
  1. Satyajeet B
    Satyajeet B avatar
    11 posts
    Member since:
    Aug 2009

    Posted 22 Sep 2009 Link to this post

     

    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. Answer
    Robert
    Robert avatar
    82 posts
    Member since:
    Jun 2009

    Posted 22 Sep 2009 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Satyajeet B
    Satyajeet B avatar
    11 posts
    Member since:
    Aug 2009

    Posted 24 Sep 2009 Link to this post

    thanks a lot Robert....... it works
Back to Top