VB控件PictureBox画实时曲线不显示
采集的数据Ifkkk(0)=2ThenLabel2.Caption=inbuf(0)IfVal(Label9.Caption)=&H1Thenkk=inbuf(0)*10...
采集的数据
If kkk(0) = 2 Then
Label2.Caption = inbuf(0)
If Val(Label9.Caption) = &H1 Then
kk = inbuf(0) * 100 / 153
Text1.Text = kk
datate(cishu) = kk
Grid.Col = 1: Grid.Row = cishu + 1
Grid.Text = kk
cishu = cishu + 1
绘图程序
Private Sub draw()
Picture1.Cls
Picture1.DrawWidth = 1
Picture1.BackColor = QBColor(15)
Picture1.Scale (0, 200)-(200, 0)
For c = 1 To cishu - 1
X1 = (c - 1): Y1 = datate(c - 1)
X2 = c: Y2 = datate(c)
Picture1.Line (X1, Y1)-(X2, Y2), QBColor(0)
Next c
End Sub
帮忙看下哪里错了怎么改才能显示 展开
If kkk(0) = 2 Then
Label2.Caption = inbuf(0)
If Val(Label9.Caption) = &H1 Then
kk = inbuf(0) * 100 / 153
Text1.Text = kk
datate(cishu) = kk
Grid.Col = 1: Grid.Row = cishu + 1
Grid.Text = kk
cishu = cishu + 1
绘图程序
Private Sub draw()
Picture1.Cls
Picture1.DrawWidth = 1
Picture1.BackColor = QBColor(15)
Picture1.Scale (0, 200)-(200, 0)
For c = 1 To cishu - 1
X1 = (c - 1): Y1 = datate(c - 1)
X2 = c: Y2 = datate(c)
Picture1.Line (X1, Y1)-(X2, Y2), QBColor(0)
Next c
End Sub
帮忙看下哪里错了怎么改才能显示 展开
4个回答
展开全部
设置一下属性试试
Form1.AutoRedraw = True
Picture1.AutoRedraw = True
另,你的Picture1.BackColor属性也改一下试试。
还有,在画图的循环里加一个语句,看看有没有进入循环。
Form1.AutoRedraw = True
Picture1.AutoRedraw = True
另,你的Picture1.BackColor属性也改一下试试。
还有,在画图的循环里加一个语句,看看有没有进入循环。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
采集的数据
If kkk(0) = 2 Then
Label2.Caption = inbuf(0)
If Val(Label9.Caption) = &H1 Then
kk = inbuf(0) * 100 / 153
Text1.Text = kk
datate(cishu) = kk
Grid.Col = 1: Grid.Row = cishu + 1
Grid.Text = kk
cishu = cishu + 1
绘图程序
Private Sub draw()
Picture1.Cls
Picture1.DrawWidth = 1
Picture1.BackColor = QBColor(15)
Picture1.Scale (0, 200)-(200, 0)
For c = 1 To cishu - 1
X1 = (c - 1): Y1 = datate(c - 1)
X2 = c: Y2 = datate(c)
Picture1.Line (X1, Y1)-(X2, Y2), QBColor(0)
doevents
Next c
doevents
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Picture1的AutoRedaw=True
再调用一下Picture1.Refresh
另外要在窗体加载之后再划线,若是放到form_load里,是肯定不显示的。以前我画过,程序代码都没问题,在窗体加载后调用划线程序就可以显示了
再调用一下Picture1.Refresh
另外要在窗体加载之后再划线,若是放到form_load里,是肯定不显示的。以前我画过,程序代码都没问题,在窗体加载后调用划线程序就可以显示了
追问
窗体加载后再画线我不是太理解
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询