C
CodeMonkey
Hi All
the following code generates an error with option strict on - Option
strict disallows late binding. Can someone please help with what needs
to be changed:
Dim sweep, totalsweep As Integer
Dim slices As Array = Split("26, 40, 34",",")
Dim colors() As Color = { _
Color.Blue, Color.LimeGreen, _
Color.Purple}
Dim brush As System.Drawing.SolidBrush
Dim g As System.Drawing.Graphics
g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i))
sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE
If totalsweep + sweep > 360 Then _
sweep = 360 - totalsweep
g.FillPie(brush, New Rectangle(0, 0, 80, 80), _
totalsweep, sweep)
totalsweep += sweep
Next
Thanks
CodeMonkey.
the following code generates an error with option strict on - Option
strict disallows late binding. Can someone please help with what needs
to be changed:
Dim sweep, totalsweep As Integer
Dim slices As Array = Split("26, 40, 34",",")
Dim colors() As Color = { _
Color.Blue, Color.LimeGreen, _
Color.Purple}
Dim brush As System.Drawing.SolidBrush
Dim g As System.Drawing.Graphics
g = Me.CreateGraphics
For i As Integer = 0 To UBound(slices)
brush = New System.Drawing.SolidBrush(colors(i))
sweep = 360 * (CLng(slices(i)) / 100) '<----PROBLEM HERE
If totalsweep + sweep > 360 Then _
sweep = 360 - totalsweep
g.FillPie(brush, New Rectangle(0, 0, 80, 80), _
totalsweep, sweep)
totalsweep += sweep
Next
Thanks
CodeMonkey.