vb.net中的静态变量 [英] Static variable in vb.net

查看:461
本文介绍了vb.net中的静态变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在vb.net中使用静态变量

在C#中,我可以像这样的"public static TextBox txtBox;" ...在vb.net中如何实现此目标...

谢谢...

Arasu

Hi,

How to use static variable in vb.net

in C# i can do like this "public static TextBox txtBox;"...how can i achieve this in vb.net...

Thanks...

Arasu

推荐答案

Dim Public Shared txtBox As TextBox


在类/模块级别使用Shared代替,在方法/过程内部使用Static.

在应用程序上使用c#代替:)
At the level of the Class/Module use Shared instead, inside a method/procure use Static.

At the application use c# instead :)


看看以下链接: http://www.harding.edu/fmccown/vbnet_csharp_comparison.html


这篇关于vb.net中的静态变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆