3

我正在尝试将 XNA 游戏移植到 MonoGame。我只想针对 Windows 平台。我想在无边框窗口中显示游戏。我在我的 XNA 游戏中这样做:

private void SetForm()
    {
        Form myForm = (Form)Form.FromHandle(this.Window.Handle);
        myForm.Name = "WIPForm";            
        int width = 1024;
        int height = 768;           
        IntPtr auxptr = (this.Window.Handle);
        SafeNativeMethods.MoveWindow(
            (int)auxptr,
            0,
            0,
            Properties.Settings.Default.width,
            Properties.Settings.Default.height,
            1);
        myForm.FormBorderStyle = FormBorderStyle.None;
        myForm.SetBounds(0, 0, width, height);
    }

当我在 monogame 版本中测试此代码时,myForm = null。单机版有什么办法可以画出无边框的窗口吗?

4

1 回答 1

10

在 MonoGame 游戏类的构造函数中:

放:

Window.IsBorderless = true;

根据: https ://monogame.codeplex.com/discussions/432292

于 2013-05-07T16:30:37.097 回答