Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. Public Class Form1
  2. Private Sub Buttonkapital_Click(sender As Object, e As EventArgs) Handles Buttonkapital.Click
  3. Dim kapital, procent As Double
  4. Dim lata As Integer
  5. kapital = CDbl(TextBoxkapital.Text)
  6. procent = CDbl(TextBoxprocent.Text) / 100
  7. lata = CInt(TextBoxlata.Text)
  8.  
  9. For i = 1 To lata
  10. kapital = kapital + kapital * procent
  11. Next
  12. TextBoxefekt.Text = CStr(kapital)
  13.  
  14. End Sub
  15.  
  16. Private Sub Buttondodaj_Click(sender As Object, e As EventArgs) Handles Buttondodaj.Click
  17. ListBox1.Items.Add(TextBoxdane.Text)
  18. End Sub
  19.  
  20. Private Sub Buttonwyczysc_Click(sender As Object, e As EventArgs) Handles Buttonwyczysc.Click
  21. ListBox1.Items.Clear()
  22.  
  23. End Sub
  24.  
  25. Private Sub Buttonusun_Click(sender As Object, e As EventArgs) Handles Buttonusun.Click
  26. Dim numer As Integer
  27. If ListBox1.SelectedIndex <> -1 Then
  28. numer = ListBox1.SelectedIndex
  29. ListBox1.Items.RemoveAt(numer)
  30. End If
  31.  
  32. End Sub
  33.  
  34. Private Sub Buttongeneruj_Click(sender As Object, e As EventArgs) Handles Buttongeneruj.Click
  35. For i = 1 To 10
  36. 'ListBox1.Items.Add(CStr(Rnd() * 20))
  37. ListBox1.Items.Add(CStr(Int(Rnd() * 21)))
  38.  
  39. Next
  40.  
  41. End Sub
  42.  
  43. Private Sub Buttonsortuj_Click(sender As Object, e As EventArgs) Handles Buttonsortuj.Click
  44. Dim n As Integer
  45. Dim tmp As String
  46. ListBox2.Items.Clear()
  47. n = ListBox1.Items.Count
  48. For i = 0 To n - 1
  49. ListBox2.Items.Add(ListBox1.Items.Item(i))
  50. Next
  51. For i = 0 To n - 1
  52. For j = 0 To n - 2
  53. If CSng(ListBox2.Items.Item(j)) > CSng(ListBox2.Items.Item(j + 1)) Then
  54. tmp = ListBox2.Items.Item(j)
  55. ListBox2.Items.Item(j) = ListBox2.Items.Item(j + 1)
  56. ListBox2.Items.Item(j + 1) = tmp
  57.  
  58. End If
  59. Next
  60. Next
  61. End Sub
  62. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement