De la caja de herramientas agregar un picturebox, un boton y un listbox.
Private Sub btnSeno_Click(sender As Object, e As EventArgs) Handles btnSeno.Click
Dim brush As New SolidBrush(Color.Blue)
Dim papel As Graphics = PictureBox1.CreateGraphics()
Dim i, x, y As Single
For i = 0 To 20 Step 0.05
If (i + 200) > PictureBox1.Width Then
Exit For
End If
y = Math.Sin(i)
ListBox1.Items.Add(y)
x = i * 30 + 50
papel.FillEllipse(brush, x, (y * 150) + 200, 10, 10)
Thread.Sleep(1000)
Next
End Sub
download source code
No hay comentarios:
Publicar un comentario