
Originally Posted by
jajarem64
Oh and there is something else I could use some help on my slider is not changing the time for it I thought this would be the right way to do it.
Code:
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
My.Settings.RemInjectTime = TrackBar1.Value
My.Settings.Save()
My.Settings.Reload()
If TrackBar1.Value = 0 Then
Form2.Timer1.Interval = 5
If TrackBar1.Value = 1 Then
Form2.Timer1.Interval = 10
If TrackBar1.Value = 2 Then
Form2.Timer1.Interval = 20
If TrackBar1.Value = 3 Then
Form2.Timer1.Interval = 30
If TrackBar1.Value = 4 Then
Form2.Timer1.Interval = 40
If TrackBar1.Value = 5 Then
Form2.Timer1.Interval = 50
If TrackBar1.Value = 6 Then
Form2.Timer1.Interval = 60
If TrackBar1.Value = 7 Then
Form2.Timer1.Interval = 70
If TrackBar1.Value = 8 Then
Form2.Timer1.Interval = 80
If TrackBar1.Value = 9 Then
Form2.Timer1.Interval = 90
If TrackBar1.Value = 10 Then
Form2.Timer1.Interval = 100
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
You need to use Else-If command. Right now what ya doing is telling the program that if Trackbar 1's value is 0 then execute rest of the conditional statements.
Use this sub:
[php]Private Sub SetTrackbar(ByVal trackbar As TrackBar, ByVal val As Integer, ByVal interval As Integer)
If trackbar.Value = val Then
form2.Timer1.Interval = interval
End If
End Sub[/php]
Then I would call it in the trackbar_scroll event as:
[php]SetTrackbar(TrackBar1,0,5)
SetTrackbar(TrackBar1,1,10)[/php]
And so on...
The final trackbar_scroll even code should be like this:
[php]Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
My.Settings.RemInjectTime = TrackBar1.Value
My.Settings.Save()
My.Settings.Reload()
SetTrackbar(TrackBar1,0,5)
SetTrackbar(TrackBar1,1,10)
'Add rest of them yourself !!!
End Sub
[/php]
Also you can use loops for it if necessary, but I think this would solve your problem.
EDIT: When you post something, then please wait for an answer. We are not always looking at your posts only. If you don't get a reply PM / VM some user you know can solve your problem. But don't bump as it can lead you to a ban !!!