使控件全屏显示
我可以使控件(在 Windows 窗体中)全屏显示吗?我可以用 P/Invoke 来实现吗?我认为解决方案可能会遍历表单中的所有控件,然后确保它是我的控件的类型,将位置设置为 0,0,将其放在顶部,重新调整控件大小以适合表单,然后更改表单,使其填满屏幕。我宁愿用另一种方式来做,因为这种方法似乎不可靠。提前致谢。
Can I make a control (in Windows Forms) go fullscreen? Could I do it with P/Invoke? I thought that a solution might be running through all of the controls in the Form, then ensuring it is a type of my control, setting the location to 0,0, putting it on top, re-sizing the control to fit the form, and then changing the form so it fills the screen. I would prefer to do it another way because this method doesn't seem to reliable. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议最大化表单,然后将控件完全停靠到表单上。
I would recommend maximizing the form, then docking the control as full to the form.
考虑到您也想隐藏 SysTray,我知道并在多年前编写
POS
应用程序期间使用了一个解决方案。你可以这样做:这样系统托盘将被隐藏。
这里是一篇关于该主题的好文章。
但由于这是很久以前的事了,您应该检查一些可能的问题。
[DllImport("user32.dll")]
)?希望这有帮助。
Considering that you want to hide SysTray too, there is a solution I'm aware of and used long years ago during writing the
POS
applications. You could do something like this:In this way the systray will be hidden.
Here is a good article on subject.
But as this was a long time ago here you should check a couple of possible problems.
[DllImport("user32.dll")]
) ?Hope this helps.