从类获取Form1属性
我希望能够从类中获得Form1属性。宽度,左,窗口等属性等属性。这样我就可以在类中执行此操作: messagebox.show(form1.width); ,所以我想参考整个form1。我该如何在代码中执行此操作?
I want to be able to get Form1 properties from within a class. Properties such as Width, Left, WindowState, and so on. So that I can then do this in the class: MessageBox.Show(Form1.Width); So I want to reference the whole Form1. How do I do that in code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
示例1:
将实例存储在全局变量中
例如
Example 2:
You need to pass an instance to the class.
,
Example 1:
Storing the instance in a global variable,
e.g.
Example 2:
You need to pass an instance to the class.
e.g.