Hello, I'm writing a little program in VB entitled "GeoMaster". It 'allows you to slow down or speed upt the earth's rotation, adjust the tilt of the earth, and eventually change the weather.' No, that's impossible, but the program is designed to make you think that you can do these things. Hey, c'mon, I was bored...
I'm having a problem with one main area, and that concerns the timers I have in this program. I can't get more than one timer to run at the same time. I've been told I need to add in a string to make the timers syncronize, but I'm having no luck finding the needed code. Async?
---
I also want to take a screenshot and rotate it a certain amount when you click a command button, but again, I'm having no luck finding the code I need.
Could someone please help me out, I've included my code. But, please bear with me, I'm still a beginning programmer, so my code is pretty sloppy...
---
Private Sub cmdAdjust_Click()
If txtHowMuch.Text = "" Then
MsgBox "You didn't enter in a speed!", vbExclamation, "Error"
ElseIf txtHowMuch.Text = "" Then
MsgBox "Invalid Speed", vbExclamation, "Error"
ElseIf txtHowMuch.Text <> "" Then
lblInfo.Visible = True
ARProgressBar1.Value = 0
Timer1.Enabled = False
ARProgressBar1.Visible = True
tmrPB.Enabled = True
End If
End Sub
Private Sub cmdResetSpd_Click()
lblEarthSpd.Caption = 4241.8
End Sub
Private Sub Quit_Click()
Unload Form1
Unload Form2
End Sub
Function Round(nValue As Double, nDigits As _
Integer) As Double
Round = Int(nValue * (10 ^ nDigits) + _
0.5) / (10 ^ nDigits)
End Function
Private Sub Timer1_Timer()
Timer1.Interval = Rnd * 2000
If Timer1.Interval <= 1100 Then
lblEarthSpd.Caption = Round(lblEarthSpd.Caption - (Rnd * 3), 2)
ElseIf Timer1.Interval > 1100 Then
lblEarthSpd.Caption = Round(lblEarthSpd.Caption + (Rnd * 3), 2)
End If
lblMPH.Left = lblEarthSpd.Left + lblEarthSpd.Width + 50
End Sub
Private Sub resetBar()
Timer1.Enabled = True
ARProgressBar1.Visible = False
ARProgressBar1.Value = 0
txtHowMuch.Text = ""
tmrPB.Enabled = False
tmrPB.Interval = 500
End Sub
Private Sub Timer3_Timer()
lblInfo.Visible = False
GoTo 987
987 Timer3.Enabled = False
End Sub
Private Sub tmrPB_Timer()
tmrPB.Interval = tmrPB.Interval - 24
If cboUpDown.Text = "Up" Then
ARProgressBar1.Value = ARProgressBar1.Value + 5
If ARProgressBar1.Value = 100 Then
lblEarthSpd.Caption = Val(lblEarthSpd.Caption) + Val(txtHowMuch.Text)
lblInfo.ForeColor = &H80FF&
lblInfo.Caption = "Adjustment completed!"
Timer3.Enabled = True
resetBar
End If
ElseIf cboUpDown.Text = "Down" Then
ARProgressBar1.Value = ARProgressBar1.Value + 5
If ARProgressBar1.Value = 100 Then
lblEarthSpd.Caption = Val(lblEarthSpd.Caption) - Val(txtHowMuch.Text)
lblInfo.ForeColor = &H80FF&
lblInfo.Caption = "Adjustment completed!"
Timer3.Enabled = True
resetBar
End If
End If
End Sub
