使用实例VB.net访问表单属性 [英] Access Form Property with Instance VB.net
问题描述
在Windows窗体(Vb.net)中,如何在没有实例(新)的情况下访问属性?
In Windows Forms (Vb.net) how can I access the properties without instance (new) ?
Form1.Property =" ???财产减速不是一成不变的吗?什么叫这种减速方式?
Form1.Property = "" ??? the property deceleration is not static? what is called this way of deceleration?
虽然您无法访问Class1.Property! 谢谢
While you can't access Class1.Property! Thanks
推荐答案
VB.Net起到了神奇的作用,可以让您假装表单没有实例.
VB.Net does some magic to allow you to pretend that forms don't have instances.
它将创建一个隐藏的共享实例,并将对实例方法(例如,Form1.Show()
)的静态调用转换为该共享实例上的实例调用.
It creates a hidden shared instance, and converts static calls to instance methods (eg, Form1.Show()
) into instance calls on this shared instance.
这样做是为了与VB6兼容,应该避免.
This is done for VB6 compatibility and should be avoided.
这篇关于使用实例VB.net访问表单属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!