I have a Public Module that holds a Public Structure. Different forms within the solution can/will instantiate a new instance of the structure.
I would like to set default values for the structure at the same time I define the structure itself. For example, I would like to do something like:
The problem is, when I set values for the vars (as shown above), I get squigglies (underneath the var) along w/ a popup message saying; "Initializers on structure members are valid only for constants."
I guess my question can be boiled down to this; What's the best way to set default values for a structure?
tia
I would like to set default values for the structure at the same time I define the structure itself. For example, I would like to do something like:
Code:
Public Structure myStruct
Dim var1 As Int32 = 111
Dim var2 As Int32 = 222
Dim var3 As Date = DateTime.Now
End Structure
The problem is, when I set values for the vars (as shown above), I get squigglies (underneath the var) along w/ a popup message saying; "Initializers on structure members are valid only for constants."
I guess my question can be boiled down to this; What's the best way to set default values for a structure?
tia