Can a ToolWindow be always on top?

7 posts, 1 answers
  1. Paul Fountain
    Paul Fountain avatar
    10 posts
    Member since:
    Jan 2010

    Posted 29 Nov 2010 Link to this post

    I would like a ToolWindow to always stay on top when it is floating.  I don't see a property for AlwaysOnTop or TopMost on the ToolWindow class, so does anybody out there have some sneaky code that allows you to do this?
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 30 Nov 2010 Link to this post

    Hi Paul,

    This should do that for you.
    Hope this helps
    richard

    Private Sub RadDock1_FloatingWindowCreated(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.Docking.FloatingWindowEventArgs) Handles RadDock1.FloatingWindowCreated
        e.Window.TopMost = True
    End Sub
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Paul Fountain
    Paul Fountain avatar
    10 posts
    Member since:
    Jan 2010

    Posted 30 Nov 2010 Link to this post

    That worked perfectly Richard, thank you.
  5. kris
    kris avatar
    4 posts
    Member since:
    Dec 2010

    Posted 27 Jan 2011 Link to this post

    We are using the TopMost and have run into a problem, the dock/toolwindow are in Excel in our application. When setting TopMost, the window truly stays TopMost - above ALL windows on my Win7 box. Is there some other way to keep the ToolWindow on top of the parent application?

    Thanks
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 27 Jan 2011 Link to this post

    Hello,

    As far as I'm aware, TopMost is the only property that you can set in this instance.
    Regards,
    Richard
  7. kris
    kris avatar
    4 posts
    Member since:
    Dec 2010

    Posted 01 Feb 2011 Link to this post

    So my solution was to set the new window to TopMost, then SendToBack the other window that was TopMost, then BringToFront the new window. This puts all these windows in the correct order except they all float on top of other application windows. Sounds like MS need to have a TopMost just for the application.
  8. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 01 Feb 2011 Link to this post

    Glad that you have found a workaround Kris.
    Regards,
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready