How to set focus on document window?

4 posts, 1 answers
  1. Saad
    Saad avatar
    4 posts
    Member since:
    Feb 2011

    Posted 02 Feb 2011 Link to this post

    Hi Guys,

    I have a situation like a tool window is populated with different radforms name. When I click a radform name from the tool window menu list that radform appear in raddock. When user click on different radform name that form will appear.
    Now the problem is when click the name of radform which is already opened it couldn't got activated. Any suggestion to resolve the issue. I highly appreciate the reply. Please find the snap shot of the scenario for clear picture. 
    Kind Regards.

         
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 04 Feb 2011 Link to this post

    Hello,

    When you click on your tree node, in the SelectedNodeChanged event, you would need to select the correct document in the following way

    Private Sub RadTreeView1_SelectedNodeChanged(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles RadTreeView1.SelectedNodeChanged
        Dim windowName As String = e.Node.Text
        CType(Me.RadDock1.DockWindows(windowName), DocumentWindow).Select()
    End Sub

    Hope that helps
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Saad
    Saad avatar
    4 posts
    Member since:
    Feb 2011

    Posted 05 Feb 2011 Link to this post

    Hi Richard,

    :) Many thanks for the solution it worked with slight change. I used your code as suggested but it required to be casted as "HostWindow". Once again thank you for your prompt reply.
    Best Regards,
    Saad
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 05 Feb 2011 Link to this post

    Hi Saad,
    You're welcome. Glad I could be of help.
    Regards,
    Richard
Back to Top