Screen Coordinate for a floating RadPane

3 posts, 0 answers
  1. Chris
    Chris avatar
    17 posts
    Member since:
    Nov 2009

    Posted 19 Sep 2012 Link to this post

    Hi,

    I need to get the screen coordinates for a floating RadPane so that I can determine which screen\monitor it is on.

    Does anyone know the easiest way to get this value?

    By the way remember I am using WPF and not WinForms.

    Thanks heaps.
  2. Chris
    Chris avatar
    17 posts
    Member since:
    Nov 2009

    Posted 20 Sep 2012 Link to this post

    What I am actually trying to do is float a docked RadPane and move it to a different monitor\screen.

    Below is the code I have so far.  Any ideas why this is not working or how I should be doing this?

    pane.MakeFloatingDockable();
    var screen = System.Windows.Forms.Screen.AllScreens[1];
    var content = (FrameworkElement)pane.Content;
    var point = new Point(screen.WorkingArea.X, screen.WorkingArea.Y);
    RadDocking.SetFloatingLocation(pane.PaneGroup.ParentContainer, point);
    RadDocking.SetFloatingSize(pane.PaneGroup.ParentContainer, new Size(content.RenderSize.Width, content.RenderSize.Height));
  3. UI for WPF is Visual Studio 2017 Ready
  4. Chris
    Chris avatar
    17 posts
    Member since:
    Nov 2009

    Posted 20 Sep 2012 Link to this post

    Just worked this one out. Need to use ToolWindow.

                            pane.MakeFloatingDockable();
                            var window = pane.GetParentToolWindow();
                            var screen = System.Windows.Forms.Screen.AllScreens[1];
                            if (window != null)
                            {
                                var content = pane.Content as FrameworkElement;
                                if (content != null)
                                {
                                    window.Left = screen.WorkingArea.X;
                                    window.Top = screen.WorkingArea.Y;
                                    window.Width = content.Width;
                                    window.Height = content.Height;
                                }
                            }
Back to Top