HkgStudioPL

Kod do Progress Bara i stucznego KeyGena

Apr 24th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.25 KB | None | 0 0
  1.  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2.  
  3.         ProgressBar1.Increment(1)
  4.  
  5.         If ProgressBar1.Value = ProgressBar1.Maximum Then
  6.  
  7.             Timer1.Stop()
  8.  
  9.             Dim kod As Integer
  10.  
  11.             kod = (Rnd() * 9)
  12.  
  13.             Select Case kod
  14.  
  15.                 Case 1
  16.  
  17.                     TextBox1.Text = "kod1"
  18.  
  19.                 Case 2
  20.  
  21.                     TextBox1.Text = "kod2"
  22.  
  23.                 Case 3
  24.  
  25.                     TextBox1.Text = "kod3"
  26.  
  27.                 Case 4
  28.  
  29.                     TextBox1.Text = "kod4"
  30.  
  31.                 Case 5
  32.  
  33.                     TextBox1.Text = "kod5"
  34.  
  35.                 Case 6
  36.  
  37.                     TextBox1.Text = "kod6"
  38.  
  39.                 Case 7
  40.  
  41.                     TextBox1.Text = "key7"
  42.  
  43.                 Case 8
  44.  
  45.                     TextBox1.Text = "kod8"
  46.  
  47.                 Case 9
  48.  
  49.                     TextBox1.Text = "kod9"
  50.  
  51.             End Select
  52.  
  53.             MsgBox("Udalo sie")
  54.  
  55.         End If
  56.  
  57.     End Sub
  58.  
  59.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  60.  
  61.         Timer1.Start()
  62.  
  63.         ProgressBar1.Value = ProgressBar1.Minimum
  64.  
  65.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment