On Jun 1, 2009, at 12:39 AM, Norman Palardy wrote:
Why can't I cast a CheckBox.CheckedState to a CheckState? is it a
bug?
Or a typo ?
Your Enum is called CheckStates not CheckState
In the first case at least there was no Typo. Here is the code copy
and pasted.
Sub DrawCheckmark(Extends g as Graphics, State As
CheckBox.CheckedStates, X as integer, Y As Integer, Size as Integer
= 0, Height As Integer = 0, Width As integer = 0)
g.DrawCheckmark CheckStates(State), X,Y, Size, Height, Width
End Sub
Here is the error message:
Code, Dingbats.DrawCheckmark, line 1, Type mismatch error. Expected
Dingbats.CheckStates, but got CheckBox.CheckedStates, g.DrawCheckmark
CheckStates(State), X,Y, Size, Height, Width
But I was wrong in the second case and must have had a typo because
this complies: (copy and pasted)
g.DrawCheckmark CheckStates(Integer(State)), X,Y, Size, Height, Width
While I would expect to be able to do CheckStates(State) doing
CheckStates(Integer(State)) is a trivial workaround.
For a REALLY frustrating bug i spent a couple of hours banging my
head against the wall before I realized the problem was not me , and
which will mean major design change and ... see my next Email...
- karen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|