Cannot declare a variable with public access in a class from a module

后端 未结 2 1736
感情败类
感情败类 2021-01-24 11:48

I am making a GUI based application (forms), and encountered the following error.

Firstly, I am declaring the following stuff in a module

Module test_mod         


        
2条回答
  •  没有蜡笔的小新
    2021-01-24 11:56

    Try this:

    Public Module test_mod
        Public Structure sub_struct
            Public test_int() As Integer
    
            Public Sub foo()
                ReDim test_int(3)
            End Sub
        End Structure
    
        Public Structure main_struct
            Public test_aaa As sub_struct
        End Structure
    End Module
    

    Source: http://msdn.microsoft.com/en-us/library/aaxss7da.aspx

提交回复
热议问题