Y
yxq
Hello
Can anyone convert the vb6 code to vb.net? Thank you!
**************************************************************
Const SPACE = 5
Const BAR_WIDTH = 50
Public GraphPoints(0 To 99) As Long
Sub DrawUsage(lUsage As Long, picPercent As PictureBox, picGraph As
PictureBox)
Dim Cnt As Long
picPercent.ScaleMode = vbPixels
For Cnt = 0 To 10
picPercent.Line (SPACE, SPACE + Cnt * 3)-(SPACE + BAR_WIDTH, SPACE +
Cnt * 3 + 1), IIf(lUsage >= 100 - Cnt * 10 And lUsage <> 0, &HC000&,
&H4000&), BF
Next Cnt
ShiftPoints
GraphPoints(UBound(GraphPoints)) = lUsage
picGraph.Cls
For Cnt = LBound(GraphPoints) To UBound(GraphPoints) - 1
picGraph.Line (Cnt, 100 - GraphPoints(Cnt))-(Cnt + 1, 100 -
GraphPoints(Cnt + 1)), &H8000&
Next Cnt
End Sub
'Shift all the points from the graph one place to the left
Sub ShiftPoints()
Dim Cnt As Long
For Cnt = LBound(GraphPoints) To UBound(GraphPoints) - 1
GraphPoints(Cnt) = GraphPoints(Cnt + 1)
Next Cnt
End Sub
****************************************************************************
***********************
Can anyone convert the vb6 code to vb.net? Thank you!
**************************************************************
Const SPACE = 5
Const BAR_WIDTH = 50
Public GraphPoints(0 To 99) As Long
Sub DrawUsage(lUsage As Long, picPercent As PictureBox, picGraph As
PictureBox)
Dim Cnt As Long
picPercent.ScaleMode = vbPixels
For Cnt = 0 To 10
picPercent.Line (SPACE, SPACE + Cnt * 3)-(SPACE + BAR_WIDTH, SPACE +
Cnt * 3 + 1), IIf(lUsage >= 100 - Cnt * 10 And lUsage <> 0, &HC000&,
&H4000&), BF
Next Cnt
ShiftPoints
GraphPoints(UBound(GraphPoints)) = lUsage
picGraph.Cls
For Cnt = LBound(GraphPoints) To UBound(GraphPoints) - 1
picGraph.Line (Cnt, 100 - GraphPoints(Cnt))-(Cnt + 1, 100 -
GraphPoints(Cnt + 1)), &H8000&
Next Cnt
End Sub
'Shift all the points from the graph one place to the left
Sub ShiftPoints()
Dim Cnt As Long
For Cnt = LBound(GraphPoints) To UBound(GraphPoints) - 1
GraphPoints(Cnt) = GraphPoints(Cnt + 1)
Next Cnt
End Sub
****************************************************************************
***********************