简体   繁体   English

使用实例VB.net访问表单属性

[英]Access Form Property with Instance VB.net

In Windows Forms (Vb.net) how can I access the properties without instance (new) ? 在Windows窗体(Vb.net)中,如何在没有实例(新)的情况下访问属性?

Form1.Property = "" ??? Form1.Property =“”??? the property deceleration is not static? 财产减速不是静止的? what is called this way of deceleration? 什么叫这种减速方式?

While you can't access Class1.Property! 虽然你不能访问Class1.Property! Thanks 谢谢

VB.Net does some magic to allow you to pretend that forms don't have instances. VB.Net做了一些魔术让你假装表单没有实例。

It creates a hidden shared instance, and converts static calls to instance methods (eg, Form1.Show() ) into instance calls on this shared instance. 它创建一个隐藏的共享实例,并将静态调用转换为实例方法(例如, Form1.Show() )到此共享实例上的实例调用。

This is done for VB6 compatibility and should be avoided. 这是为了兼容VB6而应该避免。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM