Private Sub Command1_Click()
Dim i As Long
Form1.Cls
Form1.CurrentX = 500
Form1.CurrentY = Form1.Height - 1500
Form1.Line -(Form1.Width - 500,Form1.Height - 1500)
'生成横坐标
Form1.CurrentX = 500 + (Form1.Width - 1000) / 2
Form1.CurrentY = Form1.Height - 6000
Form1.Line -(500 + (Form1.Width - 1000) / 2,Form1.Height - 1500)
'生成纵坐标
Form1.CurrentX = (Form1.Width - 1000) / 2 + 500 + (-6) * 100
Form1.CurrentY = Form1.Height - 1500 - (-6) ^ 2 * 100
For i = -5 To 6
Form1.Line -((Form1.Width - 1000) / 2 + 500 + i * 100,Form1.Height - 1500 - i ^ 2 * 100)
Next i
End Sub
这段代码是Y=X^2的曲线,曲线光滑度设定的不是很高,为了便于理解.
例子很简单:希望对你能有启发:)