Salut,
Bon je te dis tout de suite, ce code n'est pas de moi mais j'espère qu'il t'aidera.
Il faut juste ajouter une picture box sur ta form.
'------------------------------------------
' Graphiques
'-------------------------------------------
'Vous voulez créer des graphiques? Ce code
'source vous permet de tracer des fonctions
'dans une PictureBox.
'-------------------------------------------
'Auteur: Dombeu Kouam Carlos
'E-Mail: camernet@ifrance.com
'Site: http://www.ifrance.com/camernet
'-------------------------------------------
'********
' VOUS POUVEZ UTILISER GRAPH
'*********
'G.ThisSet = 1
'G.AutoInc = 0 'off
'G.XAxisStyle = 2 'user defined
'G.NumPoints = 16
'Randomize
'For i = 0 To G.NumPoints - 1
' G.ThisPoint = i + 1
' G.XPosData = i * 1000
' G.GraphData = Rnd * 100
'Next
'G.XAxisTicks = G.NumPoints - 1
'G.DrawMode = 2 'draw
'**********
' OU ENCORE POUR DES FONCTIONS COMME y = x ^ 3 / 5 - 3 * x + 1)
' VOUS UTILISEZ CECI
'**********
'Créer Picture1 et mettre
' Width = 4455
' Height = 4455
' AutoRedraw = True
'Dans Form_Load, on mettra ensuite:
Private Sub Form_Load()
Dim i As Integer
Dim x As Single
Dim y As Single
Picture1.Scale (-10, 10)-(10, -10)
' Dessine l'axe X
Picture1.Line (-10, 0)-(10, 0)
For i = -9 To 9
Picture1.Line (i, -0.5)-(i, 0.5)
Next i
' Dessine l'axe Y
Picture1.Line (0, -10)-(0, 10)
For i = -9 To 9
Picture1.Line (-0.5, i)-(0.5, i)
Next i
' EX: Dessine y = 4 * sin(x). en Rouge
Picture1.ForeColor = vbRed
x = -10
y = 4 * Sin(x)
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = -10 To 10 Step 0.25
y = 4 * Sin(x)
Picture1.Line -(x, y)
Next x
' EX: Dessine y = x ^ 3 / 5 - 3 * x + 1. en bleu
Picture1.ForeColor = vbBlue
x = -10
y = x ^ 3 / 5 - 3 * x + 1
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = -10 To 10 Step 0.25
y = x ^ 3 / 5 - 3 * x + 1
Picture1.Line -(x, y)
Next x
End Sub
Voila et bonne prog
@ +
:) Xavier :)