Private Sub Form_Load()
    Dim i As Long
    With Picture1
        .AutoRedraw = True
        .BackColor = vbWhite
        .Cls
    End With
    
    End SubPrivate Sub MSFlexGrid1_Scroll()
    Dim x1 As Long, i As Long
    
    If m_VisibleRows = 0 Then
        m_VisibleRows = MSFlexGrid1.Rows - MSFlexGrid1.TopRow
    End If
    x1 = MSFlexGrid1.TopRow
    
    Picture1.Cls
    Picture1.Scale (x1, 18)-(x1 + m_VisibleRows - 1, -18)
    Picture1.ForeColor = &H808080
    For i = -15 To 15 Step 5
        Picture1.Line (x1, i)-(x1 + m_VisibleRows - 1, i)
    Next
    
    Picture1.ForeColor = vbBlue
    Picture1.CurrentX = x1
    Picture1.CurrentY = CInt(MSFlexGrid1.TextMatrix(x1, 1))
    
    For i = x1 + 1 To MSFlexGrid1.Rows - 1
        If (i - x1) > m_VisibleRows Then Exit For
        Picture1.Line -(i, CInt(MSFlexGrid1.TextMatrix(i, 1)))
    Next
End Sub
这段代码想改成不读取MSFlexGrid1.TextMatrix(i, 1)的数据了,改成打开窗体默认读取下面的b,该如何改,而且现在的曲线图没有标识MSFlexGrid1.TextMatrix(i, 1),就是在曲线图x,y这点上方显示相应的MSFlexGrid1.TextMatrix(i, 1)数值,改完就应该是显示b的数值了,劳烦老师帮忙修改一下,最好能有每行代码的解释,因为刚接触Picture,有些东西不太了解,可能cc.txt里的数据比较多,最好能给Picture加一个横向滑动条
Private Sub Command1_Click()
Dim dd() As String
Dim a(2) As Integer
Dim Str As String
Open App.Path & "\cc.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, Str
           dd = Split(Str, ",")
          a(0) = dd(1) Mod 10
    a(1) = (dd(1) \ 10) Mod 10
    a(2) = (dd(1) \ 100) Mod 10
    b = a(0) + a(1) + a(2)
            Loop
        Close #1
End Sub
谢谢