开发者

VB: Accessing variable throughout the application

I have no of forms in VB 6. I want to access the value of one variable throughout the application.

What is the way to create global variable in VB 6.

EDIT: I want to create o开发者_JAVA技巧nly one global variable. I am new to VB,So Please give me some code snippet

Thanks.


Create a module file (a file with the extension .bas) and in the (Declarations) section place something like the following in it:-

 Public MyVariable As String


create a module and declare the variable there. Actually,you dont need to specify the Public keyword,things in module are by default treated as Public

Dim var1 as string

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜