Enums
Thanks.
1.
Private Enum Importants
Low = 0
Normal = 1
High = 2
End Enum
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For Each i As Integer In [Enum].GetValues(GetType(Importants))
MsgBox(i)
Next
End Sub
I'm writing automation scripts for activeX control.
Suppose: MyOCXCtrl.ocx.
WriterType enum and Writer Property are included in MyOCXCtrl.ocx.
Public Enum WriterType
StringWriter
ObjectWriter
BinaryWriter
End Enum
Private mWriter As WriterType
Public Property Get Writer() As WriterType
Writer = mWriter
End Property
Public Property Let Writer(vType As WriterType)
mWriter = vType
End Property
In my scripts, I like to writer as same as the following one.
TestScript.frm from other standard exe project.
Public Sub CheckingWriterProperty()
Dim ow as New MyOCX
Dim e
For Each e In [Enum].GetValues(GetType(WriterType))
ow.Writer = e
Msgbox ow.Writer
Next
End Sub
I don't want to write each enum's value manually because it might be wrong if another value is added into enum..
Public Enum WriterType
StringWriter
ObjectWriter
BinaryWriter
AnotherWriter
End Enum
Any Idea would be appreciated.

