XNA - 设置 Windows 始终位于底部
假设我用 XNA 创建了一个小游戏。现在我可以通过简单地通过铸造和获取其表单对象来更改游戏的窗口属性。像使用普通 C# 形式一样使用它。
Form MyGameForm = (Form)Form.FromHandle(Window.Handle);
MyGameForm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
现在我希望这个窗口(表单)应该始终在底部,与始终在顶部完全相反。这意味着窗口应该留在后面,即使我与它交互也永远不会获得焦点。
我不知道该怎么做,但对于 C# 中的其他内容,我们重写该函数并处理我们想要的任何内容并返回 false。对于输入文本框等,但我不知道如何覆盖表单焦点方法或将表单设置为顶部或底部或桌面上打开的窗口中的任何索引。
Lets say i have created a small game with XNA. Now i can change the windows attributes of the Game by simply obtaining its Form Object by casting & do stuff with it as i can do with normal C# form.
Form MyGameForm = (Form)Form.FromHandle(Window.Handle);
MyGameForm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
now i want that this window(Form) should Always-on-Bottom, complete opposite of Always-on-Top. Meaning the window should stay on the back and never take focus even if i interact with it.
i don't know how to do it but for other stuff in C# we override that function and process whatever we want and return false. For input n text boxes etc. but i don't know how to over ride form focus method or what sets form to on top or bottom or at any index in opened windows on desktop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在不需要它,我已经找到了解决方案,我将简单地避免为自己制作所有内容的动画并使用他们已经构建的东西,Windows Dreamscene。
no need for it now, i have got the solution, i will simple avoid animating all the stuff for my self and use something that they already built, Windows Dreamscene.