Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Buttonkapital_Click(sender As Object, e As EventArgs) Handles Buttonkapital.Click
- Dim kapital, procent As Double
- Dim lata As Integer
- kapital = CDbl(TextBoxkapital.Text)
- procent = CDbl(TextBoxprocent.Text) / 100
- lata = CInt(TextBoxlata.Text)
- For i = 1 To lata
- kapital = kapital + kapital * procent
- Next
- TextBoxefekt.Text = CStr(kapital)
- End Sub
- Private Sub Buttondodaj_Click(sender As Object, e As EventArgs) Handles Buttondodaj.Click
- ListBox1.Items.Add(TextBoxdane.Text)
- End Sub
- Private Sub Buttonwyczysc_Click(sender As Object, e As EventArgs) Handles Buttonwyczysc.Click
- ListBox1.Items.Clear()
- End Sub
- Private Sub Buttonusun_Click(sender As Object, e As EventArgs) Handles Buttonusun.Click
- Dim numer As Integer
- If ListBox1.SelectedIndex <> -1 Then
- numer = ListBox1.SelectedIndex
- ListBox1.Items.RemoveAt(numer)
- End If
- End Sub
- Private Sub Buttongeneruj_Click(sender As Object, e As EventArgs) Handles Buttongeneruj.Click
- For i = 1 To 10
- 'ListBox1.Items.Add(CStr(Rnd() * 20))
- ListBox1.Items.Add(CStr(Int(Rnd() * 21)))
- Next
- End Sub
- Private Sub Buttonsortuj_Click(sender As Object, e As EventArgs) Handles Buttonsortuj.Click
- Dim n As Integer
- Dim tmp As String
- ListBox2.Items.Clear()
- n = ListBox1.Items.Count
- For i = 0 To n - 1
- ListBox2.Items.Add(ListBox1.Items.Item(i))
- Next
- For i = 0 To n - 1
- For j = 0 To n - 2
- If CSng(ListBox2.Items.Item(j)) > CSng(ListBox2.Items.Item(j + 1)) Then
- tmp = ListBox2.Items.Item(j)
- ListBox2.Items.Item(j) = ListBox2.Items.Item(j + 1)
- ListBox2.Items.Item(j + 1) = tmp
- End If
- Next
- Next
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement