辅助监视器显示部分主监视器

Secondary Monitor shows part of Primary Monitor

我创建了一个 win 应用程序,它使用辅助显示器显示图像。 我使用以下代码来检测和设置辅助监视器的位置(这是主监视器的扩展监视器)。

public void secondarydisplay()
{

    FrmSecondaryDisplay secdis = new FrmSecondaryDisplay();
    Screen[] screens = Screen.AllScreens;
    secdis.MyBase = this;
    this.MySecScreen = secdis;
    secdis.Show();
    setFormLocation(secdis, screens[1]);

}

private void setFormLocation(Form form, Screen screen)
{
    Rectangle bounds = screen.Bounds;
    form.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height);
    form.StartPosition = FormStartPosition.Manual;

}

问题是我在副显示屏的最左角看到这条 6 毫米的细白线。这不过是主显示的扩展。我如何让它消失?将光标移动到辅助监视器并单击辅助监视器的屏幕时,这条白线消失了。将光标移回主监视器并单击它会使白线出现在辅助监视器上。请帮助我如何解决这个问题。副吸尘器看起来很难看

始终在 Show()

之前准备好 window 属性
public void Secondarydisplay()
{

    if (Screen.AllScreens.Count() == 1)
    {
        return; // No second display
    }

    var secdis = new FrmSecondaryDisplay();

    // Actually you shall use secdis.Show(this) to build the relation of the forms. 
    // When "this" closes, the second display form closes.
    secdis.MyBase = this; 
    this.MySecScreen = secdis;


    // Setup Windows Position before Show()
    secdis.StartPosition = FormStartPosition.Manual;
    secdis.Location = Screen.AllScreens[1].WorkingArea.Location;
    secdis.TopMost = true;
    secdis.FormBorderStyle = FormBorderStyle.None;
    secdis.WindowState = FormWindowState.Maximized;

    secdis.Show(this); // See comment above
}