How to maximize window in XNA

后端 未结 5 2027
离开以前
离开以前 2021-01-14 22:35

This SHOULD be a very simple question but after lots of searching there seems to be no working example anywhere. I just want my XNA window to start off maximized. I know how

5条回答
  •  走了就别回头了
    2021-01-14 23:07

    You can add a reference to System.Windows.Forms and System.Drawing (However, You will need to type the namespaces out, Because of ambiguities)

    Use the following code after base.Initialize

    Form form = (Form)Form.FromHandle(Window.Handle);
    form.Location = Point(0, 0);
    form.Size = Screen.PrimaryScreen.WorkingArea.Size;
    

提交回复
热议问题