Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
- PictureBox1.Height = 240 - (5 * TrackBar1.Value)
- End Sub
- Sub Delay(ByVal dblSecs As Double)
- Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
- Dim dblWaitTil As Date
- Now.AddSeconds(OneSec)
- dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
- Do Until Now > dblWaitTil
- Application.DoEvents() ' Allow windows messages to be processed
- Loop
- End Sub
- Private Sub TrackBar1_MouseCaptureChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.MouseCaptureChanged
- Dim A, fi, k, w, mass As Double
- fi = 1.2
- k = 0.5
- mass = 0.05 ' 50 gramov
- w = Math.Pow(k / mass, -2)
- A = 5 * TrackBar1.Value
- Dim time As Integer
- time = 0
- While time < 100000
- PictureBox1.Height = 240 + A * Math.Cos(w * time + fi)
- TextBox1.Text = PictureBox1.Height
- time = time + 5
- Call Delay(0.01)
- End While
- TrackBar1.Value = 0
- PictureBox1.Height = 220
- End Sub
- Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement