I am trying to create and initialize an array of structs of a fixed size. Each struct will be populated when a button is clicked. Here is an example of my struct:
public structure buttonStruct
dim x() as Boolean
dim y() as Boolean
dim z as Boolean
dim q as integer
Public Sub Initialize()
Me.x = New Boolean(32) {}
Me.y = New Boolean(32) {}
Me.z = New Boolean
Me.q = New integer
End Sub
end structure
In my form_load function I am declaring the array of structs and:
Dim BtnStruct(15) As ButtonStruct
BtnStruct(0).Initialize()
BtnStruct(1).Initialize()
.
.
BtnStruct(15).Initialize()
Whenever a specific button is clicked, I am trying to collect data and store it in the respective struct and so for example, if button 1 is clicked then I will store the data associated with button 1 into BtnStruct(0). The position of the button is stored in a public variable called BtnNum. If I attempt to store information in the struct inside another function as follows, I receive an error
BtnStruct(BtnNum).x(pos - 1) = temp
"btnstruct is not declared. it may not be inaccessible due to its protection level"
Any ideas?

