3
I have the following code:
System.Windows.Point ponto = PointToScreen(Mouse.GetPosition(this)); JanelaAbrir.Left = ponto.X; JanelaAbrir.Top = ponto.Y; JanelaAbrir.ShowDialog();
It opens the Window in mouse position, but this window can exceed the limits of the monitor, how can I make it not to exceed the limits?
To illustrate better follows a picture:
When opening the window exceeds the edge, screen limit (monitor), preventing the user to see the full window, forcing to drag.
I work, at least, because there are times that open, and sometimes the window is behind, the main one, all white...
– MeuChapeu
This is caused by something else. This code only defines the coordinates of the upper left corner of the window.
– ramaral
All right, I figured out the mistake instead of using
JanelaAbrir.Left
, was usingthis.Left
, corrected and gave no more error. Thank you!– MeuChapeu