title: Screen becomes black when repositioning Form to second monitor using Parallels VM
body: <p>I am working with Delphi 10.4.2 in Windows 10 (virtualized in Parallels) on a dual monitor system. To recreate the problem on a multi-monitor system, create a new Windows VCL Application and place two buttons on the form: <code>btnPrimaryMonitor</code> and <code>btnSecondaryMonitor</code>. Then insert this code by creating click handlers for the two buttons:</p>
  <pre><code>procedure TForm1.btnPrimaryMonitorClick(Sender: TObject);
  begin
    RepositionFormToMonitor(0);
    EnableDisableButtons;
  end;
  
  procedure TForm1.RepositionFormToMonitor(const aMonitor: Integer);
  const
    offset = 2;
  begin
    Self.Width := Screen.Monitors[aMonitor].Width - offset;
    Self.Height := Screen.Monitors[aMonitor].Height - offset;
  
    Self.Top := Screen.Monitors[aMonitor].Top;
    Self.Left := Screen.Monitors[aMonitor].Left;
  end;
  
  procedure TForm1.btnSecondaryMonitorClick(Sender: TObject);
  begin
    RepositionFormToMonitor(1);
    EnableDisableButtons;
  end;
  
  procedure TForm1.FormShow(Sender: TObject);
  begin
    EnableDisableButtons;
    Self.BorderStyle := bsNone;
    Self.FormStyle := fsStayOnTop;
    RepositionFormToMonitor(0);
  end;
  
  procedure TForm1.EnableDisableButtons;
  begin
    btnPrimaryMonitor.Enabled := (Self.Monitor.MonitorNum = 1);
    btnSecondMonitor.Enabled := (Self.Monitor.MonitorNum = 0);
  end;
  </code></pre>
  <p>This works perfectly, but as soon as I set <code>offset = 1</code> or <code>offset = 0</code> the screen becomes black!</p>
  <p>The purpose of the code is to reposition the maximized stay-on-top Form from the primary monitor to the secondary monitor by clicking on the <code>btnSecondMonitor</code> button and then back to the primary monitor by clicking on the <code>btnPrimaryMonitor</code> button.</p>
  <p>How can this problem be avoided?</p>