希望在VB中实现,按command后能依据TXT中数据在picturebox作图并显示,我从网上粘了段语句,但总报错

TXT数据如下xy345.821.09346.201.17348.122.11349.666.78350.817.00351.207.95(太长了不粘了,大致如此,有15... TXT数据如下
x y
345.82 1.09
346.20 1.17
348.12 2.11
349.66 6.78
350.81 7.00
351.20 7.95 (太长了不粘了,大致如此,有15-18组吧)
本人菜鸟一个,我网上找的那段太长,百度不让粘,所以求助好心人帮助,帮忙写段语句能够实现功能,悬赏不多,全部在此了,希望高人能够直接给段代码,先谢过能施以援手的高人,谢谢了
展开
 我来答
zgwxm
2012-03-06 · 经典歌曲、名人名家歌曲视频
zgwxm
采纳数:1792 获赞数:21142

向TA提问 私信TA
展开全部
Private Sub Command1_Click()
Dim Msg, XPos, YPos, I
Picture1.Scale (344, 10)-(360, -1)
Picture1.Line (345, 0)-(345, 10)
Picture1.Line (345, 0)-(360, 0)
Open App.Path & "\zb.txt" For Input As #1
Input #1, Msg
I = 0
Do
Input #1, XPos, YPos
Picture1.DrawWidth = 3
If I = 1 Then
Picture1.Line (X1, Y1)-(XPos, YPos)
End If
Picture1.PSet (XPos, YPos)
X1 = XPos
Y1 = YPos
I = 1
Loop While Not EOF(1)
Close #1
End Sub
追问
您好,首先谢谢您,我还想问一下,如果希望能标出横纵坐标及箭头还有横坐标温度,纵坐标压力,需要怎么做
追答
Private Sub Command1_Click()
Dim Msg, XPos, YPos, I, J As Integer
Picture1.Scale (344, 10)-(360, -1)
Picture1.DrawWidth = 3
Picture1.Line (345, 0)-(345, 9.5)
For J = 1 To 9
Picture1.Line (344.9, J)-(345.1, J)
Next J
Picture1.Line (345, 9.5)-(344.8, 9)
Picture1.Line (345, 9.5)-(345.2, 9)
Picture1.Line (345, 0)-(359.5, 0)
For J = 346 To 358
Picture1.Line (J, -0.1)-(J, 0.1)
Next J
Picture1.Line (359.5, 0)-(359, 0.2)
Picture1.Line (359.5, 0)-(359, -0.2)
Picture1.CurrentX = 344
For J = 0 To 9
Picture1.CurrentX = 344.5
Picture1.CurrentY = J
Picture1.Print J
Next J
For J = 345 To 358
Picture1.CurrentX = J - 0.2
Picture1.CurrentY = -0.2
Picture1.Print J
Next J
Open App.Path & "\zb.txt" For Input As #1
Input #1, Msg
I = 0
Do
Input #1, XPos, YPos

If I = 1 Then
Picture1.Line (X1, Y1)-(XPos, YPos)
End If
Picture1.PSet (XPos, YPos)
Picture1.CurrentX = XPos
Picture1.CurrentY = YPos
Picture1.Print "(" & XPos & "," & YPos & ")"
X1 = XPos
Y1 = YPos
I = 1
Loop While Not EOF(1)
Close #1
End Sub
失恋的小和尚
2012-03-06 · TA获得超过1189个赞
知道小有建树答主
回答量:1430
采纳率:0%
帮助的人:1451万
展开全部
呵呵,这个不难啊
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式