How would I declare a global variable in Visual Basic?

前端 未结 3 1975
逝去的感伤
逝去的感伤 2021-01-04 23:08

I want to create a variable that can be used across multiple forms.

It\'s going to be a temporary storage place for integers.

3条回答
  •  清酒与你
    2021-01-04 23:24

    IN VB6 just declare on top code

    public GlobalVariable as string
    

    then you can use GlobalVariable in any form as you like.

    like

    GlobalVariable = "house"
    

    then you can use /call in other form

    text1 = GlobalVariable
    

    will show value "house"

提交回复
热议问题