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

Floating pane on muilitple monitors.

1 Answer 47 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Rick Knicely
Top achievements
Rank 1
Rick Knicely asked on 23 Jul 2010, 01:39 PM
How do I tell a floating pane which monitor to use?
It seems that if it get a Point from my form and use an offset that the floating pane uses the whole screen area available and not the monitor that the form is on.  I can subtract from the point to get the floating pane to be on the correct monitor, however if I use a machine with anohter monitor orientation it does not show up where expected.

Is there a way to determine which monitor a floating pane should display?

1 Answer, 1 is accepted

Sort by
0
Rick Knicely
Top achievements
Rank 1
answered on 23 Jul 2010, 03:06 PM
I've been able to solve this with the RadPane loaded event.

            EditPaneSize paneSize = ((IManningControl)ec).PaneSize;

            ToolWindow toolwindow = rp.ParentOfType<ToolWindow>();
            Int32 offsetCnt = HavePaneInDictionary(ec);
            System.Drawing.Rectangle r = System.Windows.Forms.SystemInformation.VirtualScreen;

            Double x = (r.Left * -1) + this.Left + (paneSize.FloatOffset * offsetCnt);
            Double y = (r.Top * -1) + this.Top + (paneSize.FloatOffset * offsetCnt);
            RadHelper.SetToolWindowLocation(rp, x, y);


The ToolWindow is relative to the whole screen area where as the wpf window is relative to the monitor it is on. Using the VirtualScreen you are able to do the math to account for this.
Tags
Docking
Asked by
Rick Knicely
Top achievements
Rank 1
Answers by
Rick Knicely
Top achievements
Rank 1
Share this question
or