如何隐藏XNA 4.0吗?
问题描述:
我试图隐藏我的XNA游戏窗口,但我似乎并没有能够在这里是我到目前为止已经从我能下车,谷歌试图。
I'm Trying to hide my XNA game window but i don't seem to be able to here's what I've tried so far from what i could get off google.
Form frmXNA = (Form)Form.FromHandle(this.Window.Handle);
frmXNA.Hide();
我也试过
I have also tried
Form frmXNA = (Form)Form.FromHandle(this.Window.Handle);
frmXNA.Visible = false;
我想我做的事情很简单的错误,一旦它指出,我会在大概笑我怎么没看出来。感谢您的帮助。
I figure I'm doing something very simple wrong and once it's pointed out I'll probably laugh at how i didn't see it. Thanks for the help
答
在System.Windows.Form refrence添加到项目中,然后添加使用说明书:
add the System.Windows.Form refrence to the project and then add the using statment:
using System.Windows.Forms;
然后在初始化方法补充一点:
and then add this in the Initialize method:
Form MyGameForm = (Form)Form.FromHandle(Window.Handle);
MyGameForm.FormBorderStyle = FormBorderStyle.None;
编辑:
mybee与不透明播放
mybee the playing with the opacity
Form MyGameForm = (Form)Form.FromHandle(Window.Handle);
MyGameForm.Opacity = 0;