开发者

VB: Accessing variable throughout the application

开发者 https://www.devze.com 2022-12-17 11:25 出处:网络
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.

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

精彩评论

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