在vb里怎么给坐标轴标刻度

如题所述

Sub Draw(Form As PictureBox, x As Integer, y As Integer)
    Const Offset AsSingle = 0.5
    Dim i As Long
    Form.AutoRedraw= True
    Form.Scale (-x,y)-(x, -y)  '定义坐标系
    Form.Line (-x,0)-(x, 0)    'X轴
    Form.Line (0,-y)-(0, y)    'Y轴
    For i = -x To x- 1
        Form.Line(i, 0)-(i, 0.2)   'X轴点
    Next i
    For i = -y To y- 1
        Form.Line(0, i)-(0.2, i)   'Y轴点
    Next i
    Form.Line (x,0)-(x - Offset, Offset)      'X箭头
    Form.Line (x,0)-(x - Offset, -Offset)
    Form.Line (0,y)-(-Offset, y - Offset)     'Y箭头
    Form.Line (0,y)-(Offset, y - Offset)
End Sub
Private Sub Command2_Click()
    Picture1.Cls
    Draw Picture1,10, 10
End Sub

来自:求助得到的回答
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答