I am finishing up a little Checkbox drawing utility. I need to have
an Enum with one more value than does CheckBox.CheckedState for
particular function (besides "if State =
CheckBox.CheckedState.UnChecked Then..." gets to be a bit long)
So I defined a Enun in that module:
Enum CheckStates As Integer
Unchecked
Checked
Indeterminate
AllStates = -1
End Enum
But I also want to support the CheckBox.CheckedState
So I overload the methods thusly:
//---------------------------------
Sub aMethod(State as CheckState)
...
End Sub
//---------------------------------
Sub aMethod(State as CheckBox.CheckedState)
aMethod CheckState(State) ' <------ Gives error
End Sub
//---------------------------------
Why can't I cast a CheckBox.CheckedState to a CheckState? is it a bug?
Well I figured if that did not work this would:
aMethod CheckState(Integer(State)) ' <------ STILL gives an error
Next I tried:
Dim i as integer = Integer(State)
aMethod CheckState(i)
AND that works!!!!
Have I tripped over another bug? Or is this by design?
(And yes i know I can just use a Select case- Not the point!)
- Karen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|