在VB中怎么清除上次的直方图?
我用VB做一个表决系统,现在是可以接收到数据,但发送序列号时无法清除上次投票结果的内容,帮忙看看!!!谢了程序代码:
Private Sub MSComm1_OnComm() Dim BytReceived() As Byte Dim strBuff As Variant Select Case Case 2 MSComm1.InputLen = 0 strBuff = MSComm1.Input BytReceived() = strBuff Dim i As Long For i = 0 To UBound(BytReceived) Debug.Print BytReceived(i) Next If i <= 2 Then Text2 = BytReceived(0) BytReceived(0) = 0 Else tongyi = BytReceived(0) BytReceived(0) = 0 fandui = BytReceived(2) BytReceived(2) = 0 qiquan = BytReceived(4) BytReceived(4) = 0 End If End Select '绘制直方图 'CurrentX = 2 + 2: CurrentY = Text1.Text '找到绘制“赞同”直方图的起始位置 Line (6240 + 940, 4560 - 30)-(6240 + 1880, 4560 - tongyi * 360), vbGreen, BF '绘制“赞同”直方图 CurrentX = 6240 + 1410: CurrentY = 4560 - tongyi * 360 - 200: Print tongyi Line (6240 + 2820, 4560 - 30)-(6240 + 3760, 4560 - fandui * 360), vbYellow, BF '绘制“反对”直方图 CurrentX = 6240 + 3290: CurrentY = 4560 - fandui * 360 - 200: Print fandui Line (6240 + 4700, 4560 - 30)-(6240 + 5640, 4560 - qiquan * 360), vbRed, BF '绘制“弃权”直方图 CurrentX = 6240 + 5170: CurrentY = 4560 - qiquan * 360 - 200: Print qiquan End Sub