如何获取 VB Express 8 中 Screens 集合的引用?
我直接从 MSDN 尝试过这个示例:
Dim Screens() As System.Windows.Forms.Screens
,但我找不到获取屏幕引用的方法。我检查了我的参考资料,它们看起来不错,但我可能错过了一些东西。有人经历过这个或知道一个错误吗?
编辑 0:如果您使用正确的项目类型,它会有所帮助。在 WPF 中,它是系统参数。谢谢大家。
I've tried this example directly from MSDN:
Dim Screens() As System.Windows.Forms.Screens
and I can't find a way to get a reference to the Screen. I've checked my references and they seem fine but I may have missed something. Anyone experience this or know of a bug?
EDIT 0: It helps if you're using the correct project type. In WPF, it's SystemParameters. Thanks all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相当确定您确实想要
(末尾没有
s
),因为没有Screens
类型。上面的行将Screens
声明为Screen
对象的数组 - 现在您可以对每个
Screen
执行您想要执行的任何操作。编辑不确定您仍然遇到什么参考问题。从头开始,我启动了一个新的 Windows 窗体项目,将
Form1
中的代码隐藏替换为:它运行并执行我期望的操作。这是 VS2005(不是 Express),但我无法想象这会有什么不同。
I'm fairly sure you actually want
(no
s
at the end), as there isn't aScreens
type. The above line declaresScreens
as an array ofScreen
objects - now you can doand do whatever it is you want to do with each
Screen
.edit not sure what reference problem you are still getting. From scratch, I start a new Windows Forms project, replace the code-behind in
Form1
with this:and it runs and does what I expect. This is VS2005 (not Express) but I can't imagine that would make a difference.